Results 1 to 4 of 4
  1. #1
    Derrick T. Davidson is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    142

    Simple Msg Box

    I have a form with one txt box [PickPDate] and one button [ViewReport], when i click the button if there is no date entered I want to show a msg box (preferably customized with my title, and OK. Message says "Please enter a date" and OK cancels the event, otherwise it opens the report. Please forgive me if this is to basic a question, I have searced archive threads and most are way ahead of me in Access.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    In VBA, like:

    If IsNull(Me.PickPDate) Then
    MsgBox "Please enter a date", vbOKOnly
    Else
    DoCmd.OpenReport "report name"
    End If
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Derrick T. Davidson is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    142
    Fantastic works great, I have an additional question if that is ok, how about if I have two txt boxes[PickPDate] and [PickName] and both need to be completed to achieve the actions you gave me above. Do I enter two "If" Statements or is there a better way??

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    You could do two If statements or one:

    If IsNull(Me.PickPDate) Or IsNull(Me.PickName) Then
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Sure It is very simple Yes/No
    By easedaway in forum Access
    Replies: 5
    Last Post: 02-02-2012, 11:40 AM
  2. Help with simple vba
    By mejia.j88 in forum Programming
    Replies: 21
    Last Post: 11-30-2011, 08:42 AM
  3. Need some help with simple VBA Thanks
    By everette in forum Programming
    Replies: 1
    Last Post: 08-07-2011, 08:32 AM
  4. Replies: 0
    Last Post: 10-21-2010, 08:24 AM
  5. Simple Export Not So Simple
    By jgelpi16 in forum Programming
    Replies: 11
    Last Post: 09-01-2010, 07:23 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
  •  
Other Forums: Microsoft Office Forums