VBA for tieing two

  • Thread starter Thread starter Haji
  • Start date Start date
H

Haji

Hi,

I want to create a form called SelectCustomer that has a
combo box and a command button. The combo box
ComboSelectCustomer will be based on a query of customer
names. The command button CmdSubmitCustomer will be a
submit button. What I want to do is to then have this
form directed to another form called CustomerInformation
that has various text boxes of customer information on it
such as Name, Address, City, State Zip. This information
is based on A CustomerTable. I know there is some VB code
that I plug in somewhere but I forget what this is.

If anyone can help it would be appreciated.

Thanks,

Haji
 
If you created the button with the wizard, you should see a variable
"stLinkCriteria." If you set this variable equal to Me.ComboSelectCustomer,
then it will work.

Or, more generally, you want your OpenForm command to look like:

DoCmd.OpenForm "CustomerInformation", acNormal, ,"CustomerName = '" &
Me.ComboSelectCustomer & "'"

HTH,

Marshall Smith
Project Developers, Inc.
 
Back
Top