populate field from table NOT combobox

D

DavidBonsall

Hi, I would like to complete [patients number] and [visit number] controls on
a form, and have a third control [visitID] be automatically populated from a
table where [visit ID] is the primary key. Given that two controls need to be
populated inorder to populate a third control I can't see how this can be
done using a combobox.

regards

David
 
B

Bob Quintal

=?Utf-8?B?RGF2aWRCb25zYWxs?=
Hi, I would like to complete [patients number] and [visit number]
controls on a form, and have a third control [visitID] be
automatically populated from a table where [visit ID] is the
primary key. Given that two controls need to be populated inorder
to populate a third control I can't see how this can be done using
a combobox.

regards

David
It can be done from a combobox. but If the VisitId is a primary key,
there is no need for a combobox. Just use a textbox, and in the
after_update of each of the other two controls put code that
contains thesataement
Me!VisitID = dLookup("[VisitID]","[VISIT ID]", _
"[patients number] =" & Me!cbo_PatientsNumber & " _
" AND [visit number] = " & me!cbo_visitnumber )"
 

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