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!

break vb code with a null field 1

Status
Not open for further replies.

boiker

Technical User
Oct 19, 2001
17
0
0
US
i want my vb code to break and not run if a certain field is null.

currently the vb code compares an address to the name of a graphic file, if that file exists it loads that file. If the file does not exist, it loads a noimage.jpg file. I want the code to break if the address field is null and not load the noimage.jpg.
 
Do you really want it to break or just exit the sub and give an error message.

If FileName = "noimage.jpg" then
Msgbox "No file name.."
Exit Sub
End if


 
If IsNull(Me!your form field name)
will check if a field is null.
Mary
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top