Results 1 to 6 of 6
  1. #1
    Grahamvdh is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2012
    Posts
    8

    Key outo number to populate a message box

    Hi

    I have a simple form that is used to populate a table, upon "save and new" I would like a message box to pop up that says the following.
    REMEMBER !
    Remember to write the (PTO Number) on the on the form before adding it to the file.



    The PTO Number is the index key and is an auto number.

    Thank you so much!

  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,642
    With an Access table the autonumber is populated as soon as the record is started, so have you tried:

    MsgBox "Remember to write " & Me.FieldName & " on the form..."
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Grahamvdh is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2012
    Posts
    8
    Hi Pbadly

    Thank you for the info

    I did this

    Private Sub Form_Dirty(Cancel As Integer)
    MsgBox "Remember to write " & Me.PTO_Number & " on the form..."
    End Sub

    Not quite right. The popup comes up as soon as the field populates itself but it the number is not there?

    Am I on the right track here or what?

  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,642
    Is the data in an Access table or something else? Typically I'd use the before or after update event of the form for this type of thing (at the end of their process), but that's me.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Grahamvdh is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2012
    Posts
    8
    Let me get back to where I started
    I created an embedded macro to run on the click of the save and newbutton.
    The button works perfectly and the message work but says this ""Remember to write " & Me.PTO_Number & " on the form...""

    Instead of Remember to write O00013 down etc.

    PTO_Number is the name of the field in the table.

    Thanks again for helping a total noob

  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,642
    I don't use macros, so I don't know if you can get a value from the form to include in the message.
    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. Replies: 2
    Last Post: 11-22-2011, 11:45 AM
  2. Replies: 6
    Last Post: 07-25-2011, 01:54 PM
  3. Replies: 2
    Last Post: 04-13-2011, 09:42 AM
  4. Making New Record Number Next Numerical Number
    By jhillbrown in forum Access
    Replies: 1
    Last Post: 03-10-2010, 11:06 AM
  5. Sum Of Positive Number and Negative Number
    By maysamab in forum Reports
    Replies: 1
    Last Post: 10-20-2008, 04:06 PM

Tags for this Thread

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