open a form

peterbowles

Registered User.
Local time
Today, 06:39
Joined
Oct 11, 2002
Messages
163
on form A I have a button (Edit) that when pressed opens up formB. I want the edit button to open the other form filtered

I have been using the following in the on click event of the button:
________________________________________

Dim strfilter as string

strfilter = "CustomerNumber = Forms![frmAddBill]!CustomerNumber"

Docmd.openform "frmCustomerAdmin",,strfilter"

It opens the form but not filtered buy the customer number.
(customer number is a number not text- does this make a difference)
 
Peter -

A better way to do this (more effecient that is) would be to base the form on a query and in the Customer Number field in the query put this in the criteria section:

= Forms!frmAddBill!CustomerNumber

Then all you have to do is have the form open the other form which will open based on the Customer Number from the previous form.

This method is more efficient because you are basing the form on a query and only populating the form with on record... instead of pulling all records and then filtering down to one - for more info on this search the forum for "optimize database" or "increase performance"...

HTH,
Kev
 

Users who are viewing this thread

Back
Top Bottom