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 do i 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.

Thanks,
Pahjo
 
In the DoCmd.OpenForm sequence of arguments there's one for filtering the record, one for a SQL WHERE, and the openArgs argument. Each of these can do what you need in different ways. I like the OpenArgs method--here's the Help section:

OpenArgs Property Example

The following example uses the OpenArgs property to open the Employees form to a specific employee record and demonstrates how the OpenForm method sets the OpenArgs property. You can run this procedure as appropriate — for example, when the AfterUpdate event occurs for a custom dialog box used to enter new information about an employee.

Sub OpenToCallahan()
DoCmd.OpenForm "Employees", acNormal, , , acReadOnly, _
, "Callahan"
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top