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]
--
Steve Schapel, Microsoft Access MVP
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.