Results 1 to 3 of 3
  1. #1
    newaccess is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    May 2010
    Posts
    33

    Question convert default micro to VBA codes to fix message box issue

    Hi Experts,

    Per Access 2007 form wizard, I create a form to enter data with save button. I saw a default marco code for save button.
    line 1. action OnError and arguments as next,


    line 2. action as runCOmmand and arguments as savecord
    line 3. condition as [MarcroError]<>0 ; the action as MsgBox in below additional 4 lines as
    line 4. action as GoTo record and argumemtt as ,,Next,
    Meaasge: the data have been saved. Thanks
    Beep: Yes
    type: information
    title: Access database

    When I clicked save button. the data have been saved in table But message box does not work. the data is still in fields that confused users.
    The some person suggestion to build VBS code on save button click event. I did as below
    On Error GoTo Err_dbg
    DoCmd.SaveRecord , , acNewRec
    MsgBox UCase("Data was successfully added " & vbNewLine & vbNewLine & vbCrLf & " Thanks!")
    DoCmd.GoToRecord , , acNewRec
    Err_dbg:

    MsgBox " Error No: " & Err.Number & "; Description: " & Err.Description & vbNewLine & "Please debug"

    but I receive a compile error: method or data number not found. clicked OK button yellow color focus on DoCmd.SaveRecord , , acNewRec
    I am new access person in here. hope I can got an example.

    Thanks

    newaccess

  2. #2
    newaccess is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    May 2010
    Posts
    33
    Hi Experts,

    I search online and saw http://msdn.microsoft.com/en-us/libr...ice.12%29.aspx
    That need to ass echo action line before msgbox. I find in default macro and not able find an echo item.
    Something wrong?

    new access

  3. #3
    newaccess is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    May 2010
    Posts
    33
    I find solution. issue fixed. Thanks!

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

Similar Threads

  1. Convert RTF spacing issue
    By allstar45 in forum Reports
    Replies: 1
    Last Post: 02-28-2012, 07:44 PM
  2. Zip Codes
    By Laurie B. in forum Access
    Replies: 6
    Last Post: 02-25-2011, 02:38 PM
  3. Replies: 8
    Last Post: 11-12-2010, 10:55 AM
  4. Replies: 4
    Last Post: 09-10-2010, 08:00 AM
  5. Replies: 3
    Last Post: 12-08-2009, 01:02 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