Checking for Null

N

Nylex

Just trying to stop wrong entries from happening but the following wont work
____
Private Sub NewWorkOrder_Click()
On Error GoTo Err_NewWorkOrder_Click

Debug.Print PropDesc

'Exit this sub if No property selected
If PropDesc = "" Then Exit Sub

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Auto Orders"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord , , acNewRec

Exit_NewWorkOrder_Click:
Exit Sub

Err_NewWorkOrder_Click:
MsgBox Err.DesCription
Resume Exit_NewWorkOrder_Click

End Sub
______
I can not match the PropDesc - I have tried "" and Null - the debug says it
is Null but I can not get it to exit the sub if no property selected
 
U

UpRider

I like to use the following to check text fields for null:

If len(PropDesc & vbnullstring) = 0 then exit sub

HTH, UpRider
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top