G
Guest
I don't understand Duane. What control could I use, a combo box and a list
box would be too much data for those particular controls. I'll be going off
of invoice dates and I'll be going back several years. That means I'll have
365 dates x those several years. That's why I'm thinking an input box would
be the best way to go. Anyone have any suggestions on how I could make this
work making it easier for the end-user?
Those new to this question:
My question - I have a command button that when clicked, it brings up an
input box. The
user has to put in a date (mm/dd/yyyy). I need an If statement that searches
the column, if the date typed in is in the column, of course it will bring up
the data. But if the date is not in the column, I need another input box to
come up that reads, 'Date not found, try again.' If the user doesn't want to
try again, then a command button to close the input box. (I'm not sure, but
that command button may be a default button)
Here is what I have to pull the correct date:
SELECT *
FROM tblInvLog
WHERE InvDt=[What is the invoice date? (mm/dd/yyyy)];
But again, I need an If statement that tells the user the date was not
found. Right now, if the date is not found, it still brings up the table, but
with no data.
Duane's response - Do your users a favor and use a control on a form to
enter the date. You can
then check to make sure the date is in the report's record source prior to
attempting to open. Otherwise use the On No Data event of the report to
display a message and close the report.
box would be too much data for those particular controls. I'll be going off
of invoice dates and I'll be going back several years. That means I'll have
365 dates x those several years. That's why I'm thinking an input box would
be the best way to go. Anyone have any suggestions on how I could make this
work making it easier for the end-user?
Those new to this question:
My question - I have a command button that when clicked, it brings up an
input box. The
user has to put in a date (mm/dd/yyyy). I need an If statement that searches
the column, if the date typed in is in the column, of course it will bring up
the data. But if the date is not in the column, I need another input box to
come up that reads, 'Date not found, try again.' If the user doesn't want to
try again, then a command button to close the input box. (I'm not sure, but
that command button may be a default button)
Here is what I have to pull the correct date:
SELECT *
FROM tblInvLog
WHERE InvDt=[What is the invoice date? (mm/dd/yyyy)];
But again, I need an If statement that tells the user the date was not
found. Right now, if the date is not found, it still brings up the table, but
with no data.
Duane's response - Do your users a favor and use a control on a form to
enter the date. You can
then check to make sure the date is in the report's record source prior to
attempting to open. Otherwise use the On No Data event of the report to
display a message and close the report.