S
Someone
Hello
My main form has a datasheet subform that is based on a query to a table. I
have unbound text boxes on the main form, so that users can search the
subform by entering some data and filter out like records (the query uses
'Like "*" & [Forms]![FormName]![FieldName] & "*" Or Is Null'. The user
simply enters some text into the relevant box and the data in the subform
requeries itself with matching records.
I have been asked if I could add a search on a particular field between two
dates (the dates do not appear in the subform as it's not required
information in that view). The field in question has 213 records and is
referenced elsewhere in the database using a listbox, so that users can
easily pick the correct entry they require. I would therefore like to have
a search form with an unbound list box with all 213 records and a date
picker for the 'From' and 'To' date. I would then like the existing query
in the subform (that I described above) to update with the information
entered. This is easy to get to work with just the listbox, but not with
the dates too.
I know that within a query, I can enter 'Between #dd/mm/yy# And #dd/mm/yy#'
to search between two dates, but how could I get the information I capture
from the form to update in the query? I tried referencing the relevant
field names on the form within the query (i.e. Between
#[Forms]![FormName]![FieldName]# etc), but this doesn't work because, when
opening the main form, I'm asked for the parameter values.
I'm very much hoping that this is possible. If so, can someone help me out?
Many thanks
M
My main form has a datasheet subform that is based on a query to a table. I
have unbound text boxes on the main form, so that users can search the
subform by entering some data and filter out like records (the query uses
'Like "*" & [Forms]![FormName]![FieldName] & "*" Or Is Null'. The user
simply enters some text into the relevant box and the data in the subform
requeries itself with matching records.
I have been asked if I could add a search on a particular field between two
dates (the dates do not appear in the subform as it's not required
information in that view). The field in question has 213 records and is
referenced elsewhere in the database using a listbox, so that users can
easily pick the correct entry they require. I would therefore like to have
a search form with an unbound list box with all 213 records and a date
picker for the 'From' and 'To' date. I would then like the existing query
in the subform (that I described above) to update with the information
entered. This is easy to get to work with just the listbox, but not with
the dates too.
I know that within a query, I can enter 'Between #dd/mm/yy# And #dd/mm/yy#'
to search between two dates, but how could I get the information I capture
from the form to update in the query? I tried referencing the relevant
field names on the form within the query (i.e. Between
#[Forms]![FormName]![FieldName]# etc), but this doesn't work because, when
opening the main form, I'm asked for the parameter values.
I'm very much hoping that this is possible. If so, can someone help me out?
Many thanks
M