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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to bind two forms?

Status
Not open for further replies.

pahjo

Programmer
Dec 27, 2000
10
0
0
US
I have a form in ms Access that contains information about a customer. I also have a command button on the form that opens another form which is a scanned-in invoice about the customer. The purpose of the form is to print information about the customer, but when the form opens it contains the first record in the customer list instead of the information that was on the previous form. In conclusion, what I want is when I click the command button on one form to open another form, I want the same information about the customer to appear on the form that opens.
 
1- What is the record source of the order form ?
2- What is the record source of the form that displays the scanned invoice? (are they the same)

If not how are the underlying tables related ?
Dave
gallagherd@earthlink.net
 
I don't know your situation since you did not include the code from the OnClick event of the button, however, to open a form and sychonize it the help file suggests:

DoCmd.OpenForm "Employees", , ,"LastName = 'King'"

DoCmd.OpenForm FormName:="Employees", WhereCondition:="LastName='King'"

Since you want to synchronize with some value on your first form you would most like have something like this:

DoCmd.OpenForm FormName:="Employees", WhereCondition:="LastName='" & Me.txtLastName & "'"

An alternative would be to open the form from code and set the 'Filter' and 'FilterOn' properties.

Dim frm As Form
DoCmd.OpenForm FormName:="Employees"
Set frm = Forms![frmLease]
frm.Filter = "LastName='" & Me.txtLastName & "'"
frm.FilterOn = True

I assume the OnClick code does not use the WhereCondition parameter.

Steve King
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top