customize message box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manoj9849967222
    New Member
    • Jul 2007
    • 48

    customize message box

    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
  • JConsulting
    Recognized Expert Contributor
    • Apr 2007
    • 603

    #2
    Originally posted by manoj9849967222
    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

    Comment

    • missinglinq
      Recognized Expert Specialist
      • Nov 2006
      • 3533

      #3
      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)>

      Comment

      • manoj9849967222
        New Member
        • Jul 2007
        • 48

        #4
        Originally posted by JConsulting
        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;

        Comment

        • JConsulting
          Recognized Expert Contributor
          • Apr 2007
          • 603

          #5
          Originally posted by manoj9849967222
          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

          Comment

          • manoj9849967222
            New Member
            • Jul 2007
            • 48

            #6
            Thanks JConsulting

            Its working. Thanks for your valuable reply.

            Regards
            Manoj

            Comment

            • rcollins
              New Member
              • Aug 2006
              • 234

              #7
              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.

              Comment

              • fd1
                New Member
                • Sep 2007
                • 38

                #8
                Originally posted by rcollins
                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

                Comment

                • rcollins
                  New Member
                  • Aug 2006
                  • 234

                  #9
                  Here is my sql after I had added is null to both criteria. Still get a blank report.
                  Code:
                  SELECT tblJobHours.ID, tblJobHours.HoursWorked, tblJobHours.Month, tblJobHours.Year, tblJobHours.ClientID, tblJobHours.ECId, qryClientName.ClientName, qryStaffName.StaffName
                  FROM qryClientName INNER JOIN (qryStaffName INNER JOIN tblJobHours ON qryStaffName.ID=tblJobHours.ECId) ON qryClientName.ID=tblJobHours.ClientID
                  WHERE (((tblJobHours.Month)=Forms!frmReportInfo!Combo2) AND ((qryStaffName.StaffName)=Forms!frmReportInfo!Combo11)) Or (((tblJobHours.Month) Is Null) AND ((qryStaffName.StaffName) Is Null));

                  Comment

                  • fd1
                    New Member
                    • Sep 2007
                    • 38

                    #10
                    Originally posted by rcollins
                    Here is my sql after I had added is null to both criteria. Still get a blank report.
                    Code:
                    SELECT tblJobHours.ID, tblJobHours.HoursWorked, tblJobHours.Month, tblJobHours.Year, tblJobHours.ClientID, tblJobHours.ECId, qryClientName.ClientName, qryStaffName.StaffName
                    FROM qryClientName INNER JOIN (qryStaffName INNER JOIN tblJobHours ON qryStaffName.ID=tblJobHours.ECId) ON qryClientName.ID=tblJobHours.ClientID
                    WHERE (((tblJobHours.Month)=Forms!frmReportInfo!Combo2) AND ((qryStaffName.StaffName)=Forms!frmReportInfo!Combo11)) Or (((tblJobHours.Month) Is Null) AND ((qryStaffName.StaffName) Is Null));
                    Substitute "tblJobHours.Mo nth Is Null" with "Forms!frmRepor tInfo!Combo2 Is Null" and "qryStaffName.S taffName Is Null" with "Forms!frmRepor tInfo!Combo11 IS Null" and see if it works.

                    Comment

                    • rcollins
                      New Member
                      • Aug 2006
                      • 234

                      #11
                      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
                      Code:
                      Or ((((tblJobHours.Month)=Forms!frmReportInfo!Combo2) And ((Forms!frmReportInfo!Combo11) Is Null)) Or (((qryStaffName.StaffName)=Forms!frmReportInfo!Combo11) And ((Forms!frmReportInfo!Combo2) Is Null)));

                      Comment

                      Working...