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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prevent NULL from being passed 1

Status
Not open for further replies.

bvbowes

Programmer
Oct 12, 2006
21
US
How can I prevent a NULL from being passed in this simple cmd button so that a msgbox pops up telling the user the enter a value?

***************

Private Sub CmdOpenForm_Click()

Dim rs As DAO.Recordset

Set rs = Forms!frmMainEntry.RecordsetClone
rs.FindFirst "CaseNumber=" & Me!CaseNumber

DoCmd.Close

If Not rs.NoMatch Then Forms!frmMainEntry.Bookmark = rs.Bookmark

End
End Sub

 
[tt]If Trim(Me!CaseNumber & " ")="" Then
MsgBox "Nothing to find."
Else
'Stuff
End if[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top