Results 1 to 3 of 3

Dumb Question - Can't get check to work.

  1. #1
    Dave14867 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2016
    Posts
    213

    Dumb Question - Can't get check to work.

    Hello all,



    I cannot get a simple check to work the way I want it to. I want to ceck to see if a value has been entered in WOQty, and if not I want a MsgBox to open and set focus back to WOQty field but I can't seem to get it to work properly. When I go into debug it says WOQty = null but I don't get the message box and the cursor doesn't go to WOQty field. I am not feeling well today and I know I am not thinking straight but this is beating me up.

    Private Sub WOSchedDate_AfterUpdate()
    DoCmd.RunCommand acCmdSaveRecord

    If Me.WOQty = Null Or Len(Me.WOQty = 0) Then


    MsgBox "You MUST enter a Qty for the Work Order.", vbOKOnly
    Me.WOQty.SetFocus

    End If


    Me.CmdAllocate.Visible = True
    End Sub

    Thanks

    Dave

  2. #2
    Ajax is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    7,082
    null cannot equal anything, not even itself so null=null will return null, not true or false. Use

    If isnull(Me.WOQty) Or Len......

  3. #3
    Dave14867 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2016
    Posts
    213
    Ajax,

    Thank you, I knew it was something simple, I just couldn't see it.

    Dave

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Somewhat dumb form question
    By jrock1203 in forum Forms
    Replies: 8
    Last Post: 05-15-2018, 02:13 PM
  2. Replies: 2
    Last Post: 07-02-2015, 09:21 AM
  3. Hopefully not too dumb a question...
    By Redder Lurtz in forum Access
    Replies: 2
    Last Post: 11-17-2010, 04:17 AM
  4. Dumb question about find/replace
    By Perplexed in forum Access
    Replies: 11
    Last Post: 08-04-2010, 09:53 AM
  5. Is this a dumb question?
    By jenestra in forum Database Design
    Replies: 6
    Last Post: 10-09-2009, 01:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums