
Signature
Steve Schapel, Microsoft Access MVP
> I am in a similar position, but MS help and Viescab don't help. My basic
> problem is to use a split form to get user input to display the results of
> filters on number and date fields. I've done it for text fields but keep
> getting errors these. I think I am getting the macro filter condition syntax
> wrong. I need either specific advice or a reference to a really basic macro
> book, please.
Many thanks.
The Access database is flat and has 13 fields including Surname(text),
Age(Number) and date of birth DOB(date). The aim is to have a menu driven
interface for non computer literate users to input field data to obtain
filtered outputs. I am using split forms to do this. The form includes a text
box for user input, a command button and selected fields to display
individual records from the filtered database; the bottom half of the form
displays all records from the filtered database
Text Filter(Successful)
Form-Get Surname
User input
Text Box. Properties: Caption-Type in Surname. Unbound box -Properties: Name
- txtSurname.
Command Button - Properties: Name - cmdFindSurname, Caption - Click to Find
Electors, On Click - msurname.
Macro - msurname. Action- ApplyFilter. Arguments - Where Condition -
="Surname='" & [Forms]![Get Surname]![txtSurname] & "'"
Date Filter - Unsuccessful
Form Get DOB
User Input
Text Box. Properties: Caption- Type in Date of Birth (Format **/**/****).
Unbound box, Properties:Name - txtDOB
Command Button. Properties: Name - cmdFindDOB, Caption - Click to Find
Electors, On Click - mDOB.
Macro - mDOB. Action- ApplyFilter. Arguments - Where Condition - ="DOB='" &
[Forms]![Get DOB]![txtDOB] & "'"
This fails with an error message "incompatible field data" or something very
like it.
Is my attempt to use a text box to get date field input from the user
unsound? Or is the macro argument syntax incorrect. I've spent hours trying
variations with no success; the most unpromising result being an unfiltered
output.
My results of using a similar approach to filter on a number field have also
been unsuccessful.
Can you point me in the right direction please?
Many thanks in anticipation.

Signature
Bidders
> Bidders,
>
[quoted text clipped - 7 lines]
> > wrong. I need either specific advice or a reference to a really basic macro
> > book, please.
Steve Schapel - 08 May 2008 00:20 GMT
Bidders,
Thanks for your clear explanation.
The '' delimiters are applicable to text data. With dates, you need #
delimiters instead. So, Where Condition:
="[DOB]=#" & [Forms]![Get DOB]![txtDOB] & "#"
For numbers, there are nio delimiters:
="[YourNumber]=" & [Forms]![Get Number]![txtNumber]

Signature
Steve Schapel, Microsoft Access MVP
> Many thanks.
> The Access database is flat and has 13 fields including Surname(text),
[quoted text clipped - 40 lines]
>
> Many thanks in anticipation.
Bidders - 08 May 2008 08:26 GMT
Many, many thanks Steve.
One further favour, please. It would help me and probably others if you
could indicate where we can find such information. It is not mentioned
explicitly in Viescas, for example, and it didn't help that I had no idea
what to look for!!

Signature
Bidders
> Bidders,
>
[quoted text clipped - 51 lines]
> >
> > Many thanks in anticipation.