Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Thanked 0 Times in 0 Posts

    Form selection limit (2003)

    I have a form that is a attached to a query. The query is saying [forms]![otherReps_Input]![cboUCCI] or [forms]![otherReps_Input]![cboUCCI] is Null for three different fields. On the form, I have three dropdown lists so they can select one of the lists (which ever is appropriate) and select their name. My problem is, if they don't select anything from the one of the three lists and click on preview report, they get everything. Is there any way to limit them to having to make a selection from one of the dropdown lists? I know the logic I am using in the query, makes it so that they can select one of the lists without having to select something from the other lists. I want something to happen (like a message) to tell them they have to make a selection in one of the dropdown lists. I don't want them to be able to print everything if they don't make a selection in one of the dropdown lists.....

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Form selection limit (2003)

    You can add code to the On Click event procedure of the command button, before the line with DoCmd.OpenReport:

    If IsNull(Me.cboUCCI) And IsNull(Me.cboThis) And IsNull(Me.cboThat) Then
    ' Scold the user
    MsgBox "Please select an item from one of the combo boxes!", vbExclamation
    ' And get out
    Exit Sub
    End If

    Replace cboThis and cboThat with the names of the other combo boxes (I assumed that cboUCCI is the first one).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts