By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,160 Members | 1,024 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,160 IT Pros & Developers. It's quick & easy.

customize message box

manoj9849967222
P: 48
Hi All

I have a query which gives me the data between two given dates.
Now when i run the query it gives me a message box to enter the date saying "Enter Parameter Value". I want to customize the message box in such a way that it should say "Enter date" insted of saying "Enter Parameter Value"

Is this possible. I am not quite sure about this how to work this out.

Please help

Regards
Manoj
Sep 8 '07 #1
Share this Question
Share on Google+
10 Replies


JConsulting
Expert 100+
P: 603
Hi All

I have a query which gives me the data between two given dates.
Now when i run the query it gives me a message box to enter the date saying "Enter Parameter Value". I want to customize the message box in such a way that it should say "Enter date" insted of saying "Enter Parameter Value"

Is this possible. I am not quite sure about this how to work this out.

Please help

Regards
Manoj
You can use the InputBox() function to put a custom message together for this purpose.

if you paste in the SQL for your query, we'll see if we can get the syntax right for you.

Another option would be to create a small form to allow your users to enter dates, then a button to launch the query. The query would then reference the fields on the form as criteria.


J
Sep 8 '07 #2

missinglinq
Expert 2.5K+
P: 3,532
In Design View for the Query (the Query Grid) on the Criteria line, for the given field enter

[Enter First Date]

or whatever! That's what will show when you run the Query.

Linq ;0)>
Sep 8 '07 #3

manoj9849967222
P: 48
You can use the InputBox() function to put a custom message together for this purpose.

if you paste in the SQL for your query, we'll see if we can get the syntax right for you.

Another option would be to create a small form to allow your users to enter dates, then a button to launch the query. The query would then reference the fields on the form as criteria.


J

Hi JConsulting

I have written the following SQL Statement

SELECT sales.Date, *
FROM sales
WHERE (((sales.Date) Between [sales]![date]![txtFrom] And [sales]![date]![txtTo]))
ORDER BY sales.Date;
Sep 8 '07 #4

JConsulting
Expert 100+
P: 603
Hi JConsulting

I have written the following SQL Statement

SELECT sales.Date, *
FROM sales
WHERE (((sales.Date) Between [sales]![date]![txtFrom] And [sales]![date]![txtTo]))
ORDER BY sales.Date;

does this work for you then? if you have created a form, then the syntax for that would be [forms]![yourform]![Yourfield]

??
J
Sep 10 '07 #5

manoj9849967222
P: 48
Thanks JConsulting

Its working. Thanks for your valuable reply.

Regards
Manoj
Sep 11 '07 #6

rcollins
100+
P: 234
So this worked on my report. I wanted to filter by staff and month. What if I want the report to show all of the records? If I leave the boxes empty, it gives me no records.
Nov 7 '07 #7

P: 38
fd1
So this worked on my report. I wanted to filter by staff and month. What if I want the report to show all of the records? If I leave the boxes empty, it gives me no records.
Add "Or Is Null" to the Criteria.
Ex:
[Your message here] Or is Null
Nov 7 '07 #8

rcollins
100+
P: 234
Here is my sql after I had added is null to both criteria. Still get a blank report.
Expand|Select|Wrap|Line Numbers
  1. SELECT tblJobHours.ID, tblJobHours.HoursWorked, tblJobHours.Month, tblJobHours.Year, tblJobHours.ClientID, tblJobHours.ECId, qryClientName.ClientName, qryStaffName.StaffName
  2. FROM qryClientName INNER JOIN (qryStaffName INNER JOIN tblJobHours ON qryStaffName.ID=tblJobHours.ECId) ON qryClientName.ID=tblJobHours.ClientID
  3. WHERE (((tblJobHours.Month)=Forms!frmReportInfo!Combo2) AND ((qryStaffName.StaffName)=Forms!frmReportInfo!Combo11)) Or (((tblJobHours.Month) Is Null) AND ((qryStaffName.StaffName) Is Null));
Nov 8 '07 #9

P: 38
fd1
Here is my sql after I had added is null to both criteria. Still get a blank report.
Expand|Select|Wrap|Line Numbers
  1. SELECT tblJobHours.ID, tblJobHours.HoursWorked, tblJobHours.Month, tblJobHours.Year, tblJobHours.ClientID, tblJobHours.ECId, qryClientName.ClientName, qryStaffName.StaffName
  2. FROM qryClientName INNER JOIN (qryStaffName INNER JOIN tblJobHours ON qryStaffName.ID=tblJobHours.ECId) ON qryClientName.ID=tblJobHours.ClientID
  3. WHERE (((tblJobHours.Month)=Forms!frmReportInfo!Combo2) AND ((qryStaffName.StaffName)=Forms!frmReportInfo!Combo11)) Or (((tblJobHours.Month) Is Null) AND ((qryStaffName.StaffName) Is Null));
Substitute "tblJobHours.Month Is Null" with "Forms!frmReportInfo!Combo2 Is Null" and "qryStaffName.StaffName Is Null" with "Forms!frmReportInfo!Combo11 IS Null" and see if it works.
Nov 8 '07 #10

rcollins
100+
P: 234
I added this to the end and now I can filter by staff and date, staff, date or all info. Thank you very much, works great
Expand|Select|Wrap|Line Numbers
  1. Or ((((tblJobHours.Month)=Forms!frmReportInfo!Combo2) And ((Forms!frmReportInfo!Combo11) Is Null)) Or (((qryStaffName.StaffName)=Forms!frmReportInfo!Combo11) And ((Forms!frmReportInfo!Combo2) Is Null)));
  2.  
Nov 8 '07 #11

Post your reply

Sign in to post your reply or Sign up for a free account.