seting forms record

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

Guest

I have a field in a form which searches a patient list based on the first
letter of the last name and the last 4 digits of social security number.

when i select the patient form the list that i want to view, what code do i
use to set that patient as teh record source of the form. i need the code to
return his name to the name field, ssn to the ssn field, meds to thte med
field, etc etc.

thank you,
russ
 
You don't mention "where" you are sending the results to, but assuming you
use a sub-form, then the code to launch the "main" form with the ONE patient
is very easy. You can go:


docmd.OpenForm "MainPatient",,,"id = " & me!ID

The above assumes you have a primary key id called "id"

For some screen shots of what I mean by searching, take a look here

http://www.members.shaw.ca/AlbertKallal/Search/index.html

And, some more here:
http://www.members.shaw.ca/AlbertKallal/Articles/Grid.htm

So, that above one line of code is what I placed behind the "repeating"
button in the above search screen shots. When clicked on, it launches the
main edit for with the one reocrd......
 
Albert,
also, after looking at your examples on line, how do you have it search for
john smith after smi and jo have been entered? what type of code do you use
to only find part of the field? thank you
russ
 
Back
Top