Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing variables

Status
Not open for further replies.

hirenJ

Programmer
Dec 17, 2001
72
GB
Hey all,

I have a form(1) that is the front-end for a table where primary key = DirectMailID --- From this form I need to be able to open up another form(2) (this cannot be a subform as the form(1) is continuous) where I need to potentially add records into another table using the same directMailID and another user-selected value.

How do I pass the directMailID value -- do i have to use a public variable, or is there a more cunning way?

If I open form(2) from form(1) , then nothing is displayed if records do not already exist for that DirectMailID --

any ideas?

Hj

:eek:)


 
If you display form 2 by using the docmd.openform function you can pass the value of the DirectMailID in the openArgs parameter. Then use the OnCurrent event of form 2 to assign the value to the field in the new table. Something like Forms!form2!ID.value = Me.openArgs.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top