Results 1 to 2 of 2
  1. #1
    trksbc is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    4

    Smile "Enter Parameter Value" Blank Input Validation

    Hi,

    I have a query which takes an input from the user and gives required details for that quarter, like Week ending date, month, etc. When no quarter is selected, the query result is blank. I want to introduce a validation wherein the user is forced to enter a value, and blank value is not accepted.



    Below is my Select query:

    SELECT Week_Table.Week_Ending AS [Week Ending Date], Week_Table.C_Month AS [C_Month], Week_Table.C_Year AS [C_Year]
    FROM Week_Table
    WHERE (Week_Table.C_Quarter)=[Select the Quarter: ];

    Thanks a lot in advance!

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    If it's a field on a form you can do something like

    if isnull(me.fieldname) then
    Msgbox "Nothing Selected"
    else
    'do whatever you normally do
    endif

    You've currently got it running on the query itself which isn't going to prevent the query from running. If you are clicking a button on a form to get to your query I'd also add a field that provides the data entry for the query and change your criteria to:

    forms!formname!fieldname

    instead of

    [Select the Quarter: ]

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 01-23-2011, 12:32 PM
  2. Replies: 4
    Last Post: 01-06-2011, 10:52 AM
  3. location of "enter parameter value" box
    By dcjohnso11 in forum Programming
    Replies: 1
    Last Post: 06-25-2010, 11:36 AM
  4. Replies: 0
    Last Post: 03-25-2009, 05:26 AM
  5. Replies: 1
    Last Post: 09-05-2008, 12:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums