Access 2003 - Add a new record want subform to pop up and populate with inform from main form

I have an Access 2003 form. It is patient history/information. When I add a new visit for that patient I would like to be able to have the form pop up to add this information and then also populate it with some information from the main form.
PdetersAsked:
Who is Participating?
 
Rey Obrero (Capricorn1)Connect With a Mentor Commented:

better to open the form in add mode

docmd.openform "frmVisit",datamode:=acformadd, openargs:= me.patientid
0
 
Shanmuga SundaramDirector of Software EngineeringCommented:
yes. you can do. try coding via vba.
0
 
Rey Obrero (Capricorn1)Commented:
open your popup form with the patient id as open args

docmd.openform "frmVisit", openargs:= me.patientid

in the load event of the popup form

private sub form_load()

if  not isnull(me.openargs) then
    me.patientId=me.openargs
end if

end sub
0
 
PdetersAuthor Commented:
worked wonderful!!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.