form fields programming

  • Thread starter Thread starter Nicole
  • Start date Start date
N

Nicole

I currently have two forms the first I enter in a permit
number then my command button open up the other form. I
would like for this form that opens up to have the permit
number from the first form is there a way to do this?
Thanks
 
Hi Nicole,

Put this code in the OnClick event of the commandbutton:

DoCmd.OpenForm "NameOfForm2",,,,,,Me!PermitNumber

Put this code in the OnOpen event of Form2:

Me!PermitNumber = Me.OpenArgs

You're putting the PermitNumber in the OpenArgs parameter of the DoCmd.OpenForm
statement and passing PermitNumber to Form2.
 
Nicole

Just curious (the previous responder offered a solution). Are your two
forms bound to different tables? If so, is there an underlying business
need for storing the Permit# twice?

Good luck

Jeff Boyce
<Access MVP>
 
Back
Top