Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If Statement...... help with Null value 3

Status
Not open for further replies.

cranebill

IS-IT--Management
Joined
Jan 4, 2002
Messages
1,113
Location
US
I am trying to use the following... its pretty cut and dry as to what im trying to accomplish... any one have any ideas to make it work. If i replace Is with = then the output still resorts to the else statement.


If rs1.Email Is Null Then
Forms!Quotes.Email.Visible = False
Else
Forms!Quotes.Email.Visible = True
End If

Any help would be appreciated.

Bill
 
I think what you are wanting here is not Is Null, but IsNull. IsNull is a funciton and behaves like so:
(From Access Help)
-----------------------------------------------------
IsNull Function Example

The following example uses the IsNull function to determine whether the value of a control is Null. If it is, a message prompts the user to enter data. If the value is not Null, a message displays the value of the control.

Sub ControlValue(ctlText As Control)
Dim strMsg As String

' Check that control is text box.
If ctlText.ControlType = acTextBox Then
' If value of control is Null, prompt for data.
If IsNull(ctlText.Value) Then
strMsg = "No data in the field '" & ctlText.Name _
& "'." & vbCrLf & "Please enter data for " _
& "this field now."
If MsgBox(strMsg, vbQuestion) = vbOK Then
Exit Sub
End If
' If value is not Null, display value.
Else
MsgBox (ctlText.Value)
End If
End If
End Sub
---------------------------------------

Let me know if this does not help,

Chris
 
Worked Awesome... Thanx

Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top