Results 1 to 6 of 6
  1. #1
    glen is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    171

    Form Operation


    Hello Friends,
    I have a form "Orders" there is one field "Order Date".
    So I want that when I make new order and if I forget entering date first then it should give me message " Please enter date first "
    so what is code for this?
    Thanks

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    One way:

    http://www.baldyweb.com/BeforeUpdate.htm

    You can also make the field required in the table.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    glen is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    171
    Thank you brother.
    It working fine for making new order.
    But I want that when I start new order so without entering date no field should be update.
    I tried this code on Orderdate before event but its not working.

    If Len(Me.ORDERDATE & vbNullString) = 0 Then
    MsgBox "Enter Date First"
    Cancel = True
    Me.ORDERDATE.SetFocus
    End If

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I would use the form's before update event. You can't count on the control's update event firing because it won't if the user skips over it or tabs through it.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    glen is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    171
    Ok brother.
    Thanks for your help.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Happy to help.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Pass form values to SQL JOIN operation?
    By jonman03 in forum Queries
    Replies: 3
    Last Post: 03-06-2012, 04:59 PM
  2. form operation
    By crowegreg in forum Forms
    Replies: 2
    Last Post: 08-09-2011, 04:09 PM
  3. How to verify Insert Operation
    By Sibtain in forum Queries
    Replies: 1
    Last Post: 08-04-2011, 10:19 AM
  4. Operation must use an updateable query
    By skaswani in forum Queries
    Replies: 0
    Last Post: 12-23-2010, 11:59 PM
  5. Invalid Operation
    By ScottG in forum Forms
    Replies: 0
    Last Post: 11-14-2006, 02:05 PM

Posting Permissions

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