Autofill a form

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

Guest

I am setting up a patient information db at work and was wondering if this is
a possible option:

The key field is the patientID, and as I start to key in the number, if the
patient already exists on the system can I have their details appear on the
Form (in the relevant boxes) as the patientID number is recognised? This is
so I can search the db if I need to look up details on a patient on file. If
the patientID is not recognised then I'd like to code a Msgbox that simply
says patient not on file.

Thanks for any help,
Ian.
 
Hi Ian,

Yes, this is something that you can do fairly easier. If the form in
question is linked directly to a table, you could set a filter in the On
Change event of the text field that they are entering the Patient ID in. The
filter would be something like.

frmPatientSearch.Filter = "[PatientID] = '" & txtPatientIDField & "'"
frmPatientSearch.FilterOn = True

Where frmPatientSearch is the name of your search screen.

If you don't want to use the On Change event, you could also place the above
code into a Search button.

Hope that helps.

Lance
 
Hi Lance,

Thanks for the suggestions, I like the idea of putting this in the OnChange
event. Can I just ask, how would I then pull out the other data field
associated with the entered PatientID? For example, say I had FName and SName
as two text fields along with the PatientID field in my table and the
corresponding Form had two text boxes to hold FName and SName along with a
text box where you enter the PatientID with the suggested code attached. How
could I get the FName and SName data displayed that corresponded to the
PatientID that was being entered?

Thanks again for any suggestions,
Ian.

LTofsrud said:
Hi Ian,

Yes, this is something that you can do fairly easier. If the form in
question is linked directly to a table, you could set a filter in the On
Change event of the text field that they are entering the Patient ID in. The
filter would be something like.

frmPatientSearch.Filter = "[PatientID] = '" & txtPatientIDField & "'"
frmPatientSearch.FilterOn = True

Where frmPatientSearch is the name of your search screen.

If you don't want to use the On Change event, you could also place the above
code into a Search button.

Hope that helps.

Lance



Ian said:
I am setting up a patient information db at work and was wondering if this is
a possible option:

The key field is the patientID, and as I start to key in the number, if the
patient already exists on the system can I have their details appear on the
Form (in the relevant boxes) as the patientID number is recognised? This is
so I can search the db if I need to look up details on a patient on file. If
the patientID is not recognised then I'd like to code a Msgbox that simply
says patient not on file.

Thanks for any help,
Ian.
 
Back
Top