Form-to-Form Filter

C

Chip Melton

I am tryng to build a button to jump from one form to another form using
both the Facility ID # (FACID) and Instection Date (INSPDATE) to filter the
data between the forms. The ACCESS Button Wizard only allows me to do one
(1) field like FACID->FACID or INSPDATE->INSPDATE but not both. I am
wanting to use both fields as the filter critria and have been trying
everything i can think of in VB but am really new to the VB world so this is
a stumper, Can anyone help? Let me thank you in adavance as I never know
if the my Thank You's get back to the sender. THANKS AGAIN!!!
 
G

Graham Mandeno

Hi Chip

I don't use Wizard code, so I'm not sure what you are trying to modify. It
would help if you'd posted the actual code.

However, you want to create a filter string in which *two* criteria must
apply, so you need to join those with the AND operator. Also, one of your
criteria involved a date, and SQL is very fussy about date formats (it has
no recognition of regional settings) so the data must be formatted
correctly.

What you need then, will be something like this:

strFilter = "(FACID=" & Me.FACID & ") and (INSPDATE=" _
& Format(Me.INSPDATE, "\#mm\dd\yyyy\#") & ")"

--
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand

Return mail address is invalid in a vain attempt to reduce spam.
Feedback is welcome at: (e-mail address removed)
Please post new questions or followups to newsgroup.
 

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