I have a database with a little over 5000 entries for various customers. I am looking for a way to enter date from the main form and go to the first entery for that date.
I have a database with a little over 5000 entries for various customers. I am looking for a way to enter date from the main form and go to the first entery for that date.
If you have an unbound form ,put a textbox, TxtDate
Make a query that looks at this textbox ,
select * from table where [dateField] = forms!myForm!txtDate
A button would open the query,
docmd.openquery "qMyQuery"
If you want only 1 record,the Max date,then you need 2 queries,
Q1=select ID, Max([dateFld] from table.
then Q2: uses Q1 and the data table joined on ID
I am getting the following error; Check the subquery's syntax and enclose the subquery in parentheses.
select * from [Master Table] where [Date Reported=Forms![Master Form][txtDateEnter]
DateReported doesn't have a closing ]. Are you doing this in VBA or is this the actual query?
I would to run a query form the form and have it go to the date input.
That should work. It will show all records for that date, sort it in the order that you want and show the top 1.
Is there a method, instead of displaying the results of a query, I can just have the form go to that date?
Not sure what you mean - do you want the data to be displayed on the form instead of in a query? A subform will do that, without the query. Set the record source to the table name (Master table) and link the main form to the subform using the date.
What I am looking to do is to input a date and have the form go to the first record for that date, for example if I input 5/1/2016 I would like my form to display the first record for that date
Have Master Table as the record source for the form. Add a date field as an unbound field. When the user enters the date, in the AfterUpdate event, filter the form:
Me.Filter="DateReported=#" & me!userentereddate & "#"
Me.FilterOn=True
Me.Requery
I am still not able to have the form open to a specified date, I have tried the below. Any Ideas
We need more information, a step-by-step of the process. Include any code and/or queries where applicable.