Re: Is Not Null
- From: "tina" <nospam@xxxxxxxxxxx>
- Date: Sun, 15 Feb 2009 14:57:32 GMT
On my form I have two Date Fields and Two Combo Boxes. Once all the datais
entered in the fields you click on a search button that runs the query.
according to your original post, above, you had code on a button "that runs
the query". i just gave you the code to check the search controls, and told
you where to insert the code you said you already have.
since the code you've now posted is using Select Case to open various
reports based on the value of what i assume is an option group control, i'm
not quite sure what you're doing. how about explaining how we jumped from
running a query to opening reports, and just where/when it is that you want
to check for null values in the controls you cited in your first post.
hth
"George" <George@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F98D4ACA-09BD-44DE-B0DD-8A886DC52E6B@xxxxxxxxxxxxxxxx
Thanks - I can not figure out the last part, <put here the code to "runthe
query">of
This is what I started with and then I added what you said to the bottom
my code which I am sure is wrong. I get an error message for the ElseIsNull(Me!Combo
statement.
When I click on my form's Command Button it first looks at an option group
then runs the query.
Private Sub Command13_Click()
On Error GoTo ErrorPreview
Select Case [fraPrint]
Case Is = 1
DoCmd.OpenReport "R-By_Date", acViewPreview
DoCmd.Maximize
Case Is = 2
DoCmd.OpenReport "R-By_Eval", acViewPreview
DoCmd.Maximize
Case Is = 3
DoCmd.OpenReport "R-By_W/C", acViewPreview
DoCmd.Maximize
' If you don't chose a default value, this generates a message box if the
user clicks a button without making a selection
Case Else
MsgBox "Select Report", vbExclamation, "Reports"
End Select
ExitPreview:
Exit Sub
ErrorPreview:
MsgBox Err.Description
Resume ExitPreview
Private Sub Command13_Click()
If IsNull(Me!cboStartDate) Or IsNull(Me!cboStopDate) Or
- Eval) Or IsNull(Me!Combo - Rating) Thendata
MsgBox "Data Required In Each Field."
Else
Command13_Click()
End If
End Sub
"tina" wrote:
try adding the following to the command button's procedure, as
If IsNull(Me!Date1) Or IsNull(Me!Date2) Or IsNull(Me!cboOne) _
Or IsNull(Me!cboTwo) Then
Msgbox "Enter a value in each field, please."
Else
<put here the code to "run the query">
End If
replace Date1, Date2, cboOne, and cboTwo with the correct names of the
controls, of course.
hth
"George" <George@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:FF3EFCA8-F07F-48D2-9FB8-C8B077FEAADE@xxxxxxxxxxxxxxxx
On my form I have two Date Fields and Two Combo Boxes. Once all the
query.is
entered in the fields you click on a search button that runs the
stop itAll
that works as intended. What I want to add is a function that will
infrom running if one of the fields are blank. None of the fields areconnected
to a table so I can't use the "Required" function. I tried "Not Null"
the
Validation Rule - but that doesn't work either.
Any ideas ?
Thanks - George
.
- Follow-Ups:
- Re: Is Not Null
- From: George
- Re: Is Not Null
- References:
- Is Not Null
- From: George
- Re: Is Not Null
- From: tina
- Re: Is Not Null
- From: George
- Is Not Null
- Prev by Date: Re: Is Not Null
- Next by Date: Re: Is Not Null
- Previous by thread: Re: Is Not Null
- Next by thread: Re: Is Not Null
- Index(es):
Relevant Pages
|