Multiple filters on form

C

Chegu Tom

Probably

in the double click event of a textbox
-----------------
dim stDocName, stLinkCriteria as string

stLinkCriteria = "[recordid in new form]=" & [me].[thecontrol containing
that id data on your form] & " "
stDocName="the name of your new form)
DoCmd.OpenForm stDocName, , , stLinkCriteria
-------------

If the recordid is string type then add some single quotes

stLinkCriteria = "[recordid in new form]='" & [me].[thecontrol containing
the id data] & "'"
 
C

Chegu Tom

With multiple filters you may need some ANDs or ORs in the stLinkCriteria


Chegu Tom said:
Probably

in the double click event of a textbox
-----------------
dim stDocName, stLinkCriteria as string

stLinkCriteria = "[recordid in new form]=" & [me].[thecontrol containing
that id data on your form] & " "
stDocName="the name of your new form)
DoCmd.OpenForm stDocName, , , stLinkCriteria
-------------

If the recordid is string type then add some single quotes

stLinkCriteria = "[recordid in new form]='" & [me].[thecontrol containing
the id data] & "'"



MOGSY said:
Hi. I've created a form that returns records based on multiple filters
(using
http://allenbrowne.com/ser-62.html). I would like to be able to double
click
on a result and a new form (which the user can edit the record) opens.
How
can I do this?

Thanks.
 
J

John W. Vinson

Thanks. I'll try this.

Chegu said:
With multiple filters you may need some ANDs or ORs in the stLinkCriteria
[quoted text clipped - 22 lines]

Just bear in mind: stLinkCriteria needs to be a valid SQL query WHERE clause,
without the word WHERE. It can be as complex as you wish, with subqueries,
calculated expressions, etc.

It may be helpful to create a Query in the query grid that displays the data
you want, and use View... SQL to see how Access constructs the WHERE clause.
You can then use this as a model for your stLinkCriteria.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top