Auto field detection

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

Guest

I have have two forms.
One form allows the user the enter client information. On this form there is
a button the user presses which opens a popup form to enter history (a macro
opens the popup onclick). On this form i am wanting the history form to auto
display the customer name and contact name from the previous form... how
would one go about doing this?

Thanks for any help
 
Hi, Kerry.

The following code will also be inserted (plus error checking) if you use
the command button wizard in form design view. Enable the wizard by
selecting View, Toolbox, then toggle on the wizard button (wand and two
stars). Then place a command button, choose Form Operations and follow the
prompts.

Hope this helps.
Sprinks

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Your2ndFormName"

stLinkCriteria = "[PrimaryKeyof2ndForm]=" & Me![MatchingKeyInCurrentForm]
DoCmd.OpenForm stDocName, , , stLinkCriteria
 
The Command Button is already in place, however it still does not auto detect
the company name from the previous form.... any other ideas would be great....

Thanks.

Sprinks said:
Hi, Kerry.

The following code will also be inserted (plus error checking) if you use
the command button wizard in form design view. Enable the wizard by
selecting View, Toolbox, then toggle on the wizard button (wand and two
stars). Then place a command button, choose Form Operations and follow the
prompts.

Hope this helps.
Sprinks

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Your2ndFormName"

stLinkCriteria = "[PrimaryKeyof2ndForm]=" & Me![MatchingKeyInCurrentForm]
DoCmd.OpenForm stDocName, , , stLinkCriteria



Kerry said:
I have have two forms.
One form allows the user the enter client information. On this form there is
a button the user presses which opens a popup form to enter history (a macro
opens the popup onclick). On this form i am wanting the history form to auto
display the customer name and contact name from the previous form... how
would one go about doing this?

Thanks for any help
 
Back
Top