Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

MS Access IsNull Then Compile Error Expected Then or goto WHY?????

Posted on 2016-11-18
6
Medium Priority
?
96 Views
Last Modified: 2016-11-18
Why is this not working???

Private Sub btnPrintLabels_Click()
    If Me.SkuNm.value isNull Then
      msgbox "Please Fill Out Name Title First.", vbInformation, "Message"
       SkuNm.SetFocus
    Exit Sub
   Else
     PrintLabel
      Forms!frmSkusEntry!PrintLabelQTY.value = "1"
    End If
End Sub

Open in new window

0
Comment
Question by:Dustin Stanley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 41893858
try this
Private Sub btnPrintLabels_Click()
    If  isNull(Me.SkuNm) Then
      msgbox "Please Fill Out Name Title First.", vbInformation, "Message"
       SkuNm.SetFocus
    Exit Sub
   Else
     PrintLabel
      Forms!frmSkusEntry!PrintLabelQTY.value = "1"
    End If
End Sub

Open in new window


this is my  preference

Private Sub btnPrintLabels_Click()
    If Me.SkuNm & ""="" Then
      msgbox "Please Fill Out Name Title First.", vbInformation, "Message"
       SkuNm.SetFocus
    Exit Sub
   Else
     PrintLabel
      Forms!frmSkusEntry!PrintLabelQTY.value = "1"
    End If
End Sub

Open in new window

0
 

Author Comment

by:Dustin Stanley
ID: 41893859
LOL I forgot the Parenthesis. I can't believe that! Thanks Rey! I like the other way also but couldn't think of it.
0
 

Author Closing Comment

by:Dustin Stanley
ID: 41893860
Thanks!
0
Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

 
LVL 22
ID: 41893862
IsNull, one word is a function that then expects an argument  to test. Use
If isNull (Me.SkuNm.value) Then

Open in new window

Is Null, two words, is used to compare an object to Null.  You will find this used in SQL generated for queries.
0
 

Author Comment

by:Dustin Stanley
ID: 41893866
Thanks Crystal that will broaden my knowledge so when I see it I won't be confused. :)
0
 
LVL 22
ID: 41893871
you're welcome, Dustin ~ happy to help
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question