Text box update each other

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all...

I need to have two text boxes update each other based on which one the user
puts the information into.

I have one text box called "HospitalNumber" and one called "HospitalNAme"

On the entry form, the user might have the Hospital Name or Number, so if
they enter the number, I want the Hospital Name to appear. If they enter the
Hospital Name, then I want the number to appear.

I know how to update one text box based on another, but I can't figure out
how to get both to update each other.

BTW, the info is pulled from tblFacilities, in either FacilityNumber or
FacilityName.


Thanks in advance!
 
Why not use a single combo box that displays both the hospital number and
the hospital name in the dropdown list? That eliminates the need for two
places to enter data. Then use the information in this article to display
the name in a textbox (let the number show in the combo box after the
dropdown list is closed):
http://www.mvps.org/access/forms/frm0058.htm
 
Hi,
just use two different dlookup functions on the after update event of each
control.
HTH
Good luck
 
Thanks Ken,

I am not sure if this will work. It some circumstances, there is no Hospital
Number, so the only info available to the user is the Hospital Name. If the
user only has the Hospital Name, I want the Hospital Number to auto populate
if a number exists.

Can I still achieve this using your suggestion?

Cheers
 
My suggestion assumes that your data would always have a hospital number and
a hospital name for each hospital.

If there is no number sometimes, then use the hospital name as the display
in the combobox, and the textbox then can show the number if it exists, or
else "assign" one (how is this to be done?) if there is no number already.

If it's possible that the user would be entering a new hospital without a
name or a number already in the database, then use a command button next to
the combo box to let the user add a new hospital (name and number), and then
requery the combobox's list so that the entered data are available to the
user to select.
 

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

Back
Top