Results 1 to 5 of 5
  1. #1
    mchadwick is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Posts
    71

    Hide button on Continuous form show only on new record (at bottom)


    I have a subform that is a continuous records form I am using and want to add a button on the last record\new record. I have it set up now so that the button is on every record in the subform and it works just fine, but it is only part of the new record so, I dont get the desired effect if someone presses the button on a record that is not new. Easily fixed with training, but I would really like to know how or if I can do that.

    The button is currently launching a macro.

  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
    I don't think you can hide it in such a way that it's visible for the new record at the same time it's hidden on older records. Code will apply the same treatment to all. You could add code to only run the macro for a new record:

    If Me.NewRecord Then
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    mchadwick is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Posts
    71
    Oh I like that, what do I need to add to the macro to make that work. The embedded macro goes to a control then sets property value and then opens a form.

  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
    What I posted is VBA code; I'm not sure how to test for new record in a macro, as I don't use them. If you want to convert to VBA, none of that looks difficult.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Actually, like Paul, most of the experienced developers, here, don't use Macros. But some testing shows that placing

    [NewRecord]=True

    under the 'Condition' in your Macro, to the left of the 'Action,' does the job.

    But you really should take the time to learn VBA. It's much more flexible, and you only have to go to the code module to see everything that is going on in your Form, rather than having to open each Macro, in turn. This makes figuring out what is going on in your Form, or more importantly, what is going wrong in your Form, much less labor intensive.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Replies: 2
    Last Post: 09-11-2014, 11:37 PM
  2. Moving Rows in Continuous Form Up/Down and Top/Bottom
    By RichardAnderson in forum Forms
    Replies: 2
    Last Post: 01-22-2014, 02:43 PM
  3. Replies: 1
    Last Post: 04-02-2013, 08:41 AM
  4. Replies: 3
    Last Post: 11-18-2012, 12:49 PM
  5. Replies: 7
    Last Post: 06-13-2012, 06:27 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