How to use OpenArgs property

PepeGallo

Registered User.
Local time
Yesterday, 16:29
Joined
May 2, 2008
Messages
14
Hi folks!

In an invoice form I have a lookup that finds a customer. Once a specific customer is found, a button appears. I want this button, when clicked, to open the customers forms, but showing the record of the customer found in the invoice form's lookup. I read that this can be done by using the OpenArgs parameter of the OpenForm method, but I don't know how to use it. Please help me! Thank you.
 
Pepe,

You *could* use the OpenArgs property, but there are a couple of easier methods.

1) You can base the customers form on a query, the query can use:

Forms!YourInvoiceForm!CustomerID

as the criteria for the CustomerID field.

2) You can open the Customer form like

DoCmd.OpenForm "YourCustomerForm",,,"[CustomerID] = " & Me.CustomerID

hth,
Wayne
 
If you only want to view that one record in the other form then using the WhereCondition (Wayne's suggestion #2) is the best solution. Post back if you still want to know how to use the OpenArgs to pass values.
 

Users who are viewing this thread

Back
Top Bottom