Form-to-Form Filter

  • Thread starter Thread starter Chip Melton
  • Start date Start date
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!!!
 
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.
 
Back
Top