Information field related to previous information... help!

S

Shelly

Hi, this is a little bit confusing but I hope somebody can help me!
I have a database tracking specimens from a research project. One of the
fields is 'specimen type' and the possibilities are blood, buccal swab or
saliva. I want a second field with 'blood volume' however obviously this is
only relevent if the first entry is blood, otherwise I don't need it. How can
I set this up? Help!
 
K

Keith

Shelly said:
Hi, this is a little bit confusing but I hope somebody can help me!
I have a database tracking specimens from a research project. One of the
fields is 'specimen type' and the possibilities are blood, buccal swab or
saliva. I want a second field with 'blood volume' however obviously this
is
only relevent if the first entry is blood, otherwise I don't need it. How
can
I set this up? Help!
Setp up a field in your table and bind a control on your form to it. In the
form's On Current event, have something like:

If Me.ctlMyControl = "Blood" Then
Me.ctlMyNewControl.Visible = False
Else
Me.ctlMyNewControl.Visible = True
End If

That's the general idea but you'd need to tailor your code to cope with
adding new records and deleting existing ones.

HTH - Keith.
www.keithwilby.com
 
S

Shelly

Thanks... I'm still a bit confused but it's been a long day. I'll try it
again in the morning as when I tried it just now it didn't work! Thanks though
 
J

John

What are the other fields. Are they all the same except for blood volume, or
do different specimens have different attributes.

John
 
S

Shelly

Hi.
The other fields are blood, buccal swab and saliva. For Blood I need blood
volume, for buccal swab I need number of swabs and for Saliva I need number
of pots, date posted and date recieved.
Thanks!
 
J

John

I don't understand this setup. When you say fields, do you mean fields in a
database table or are you refering to different tables. It doesn't make
sense to have three fields that are describing the sample and then have
another field in the same table with specimen type.

John
 
S

Shelly

Sorry! I didn't write that very clearly.
There is one field called "Sample Type". The possibilities for this are
Blood, Buccal Swab or Saliva.
The second field is 'Blood Volume' but this field is irrelevent to Saliva or
Buccal swabs, therefore I only want it to appear if the entry in 'sample
type' is blood.
Apologies.
 
J

John

It depends whether you are talking about the storage of the data in the
table, or data entry on a form. If you're talking about the table then
there's going to be other null fields as well as the blood volume because
the different samples have different attributes so you'll have to create
separate tables for each sample type. If you're talking about data entry ,
then you could put a option button on the form to select the sample type
which would then display or hide the necessary text boxes. But if there is a
lot of data entry involved this would become very cumbersome. Is the
database a temporary thing just for a single project or will it be fairly
permanent? Are these the only fields that need to be entered, or is there
more information. If it's permanent you need to give careful consideration
to designing it properly and ensuring that it is normalized. If it's
temporary, and these are the only fields then why not just leave the fields
that you don't need blank. You can still retreive whatever info you need by
using queries.

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top