Results 1 to 5 of 5
  1. #1
    sireesha is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    50

    Ms access 2007 macro actions

    i have a form. save button is placed i.e., embedded macro. In the form all the fields are mandatory. for all mandatory fields give message "Required field name........" . In macro isnull(fieldname)=true and action give message after gives a message macro will stop with out saving the record. message given and also saved into table. i don't want when i click the save button if all fields are entered saving is done otherwise give message and then stop the macro and cursor will placed on particular required textbox . Please give me solution for this.



    i tried with code also but its not working please help me.

  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,521
    This is the way with code:

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

    Why not make the fields required in the table?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    sireesha is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    50
    i need macro actions on save button or code on save button. when i click on save button give message "required field...",if all fields are entered it will save otherwise not saved .cursor blinks on particular field. please help me.

  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,521
    I did help you, you just didn't read the link.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    sireesha is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    50
    i tried. its not working. the code is on form_beforeupdate but i need on save button. my form is in datasheet view. i need to check with second row.how please help me. and not a one field somany fields are there in my form. for all fields i want to give message. directly go to else part record is saved. if all fields are not entered give message no need to save

    Private Sub Save_Click()
    If Me.fieldname= 0 Then
    MsgBox "You need to fill out fieldname"
    Cancel = True
    Else
    DoCmd.RunMacro "macro1"

    End If
    End Sub

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

Similar Threads

  1. Replies: 1
    Last Post: 05-02-2012, 11:40 AM
  2. access 2007 macro
    By unit91 in forum Queries
    Replies: 17
    Last Post: 04-19-2012, 02:27 PM
  3. Get "My Documents" in Access 2007 macro
    By RMittelman in forum Programming
    Replies: 7
    Last Post: 10-31-2011, 03:01 PM
  4. Macro with 3 actions
    By seweryng in forum Access
    Replies: 4
    Last Post: 01-20-2011, 10:15 AM
  5. What id macro in Access 2007
    By Alaali in forum Access
    Replies: 1
    Last Post: 02-25-2010, 02:08 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