1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Open Subform with new record - Access 2003

Discussion in 'Business Applications' started by steeleye, Mar 4, 2009.

Thread Status:
Not open for further replies.
Advertisement
  1. steeleye

    steeleye Thread Starter

    Joined:
    Mar 4, 2009
    Messages:
    2
    I have a form with a subform. When I open the form, I want the subform to display a new record. How do I make that happen? If I use a macro to "open new record" when the form opens, it displays a new record for the form as well as the subform. I want only the subform to display a new record.
     
  2. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    18,834
    I am not quite sure about the logic of what you want to do, I would have thought you would want to see historical records, but there are 2 ways to do what you want one is to set the Subform's "Data Entry" property to "Yes", this means that it can only accept new records and display those entered since the Form was opened, not older records.
    The other involves using VBA code in the Subform's "On Load" event procedure which says
    me.newrecord

    The VBA method should still have the old records available, just move to a new record.
     
  3. steeleye

    steeleye Thread Starter

    Joined:
    Mar 4, 2009
    Messages:
    2
    Thank you. I tried both methods. Both of them cause a new record to open in both the form and the subform. I want only the subform to display a new record. Since it can be accomplished with a button, it must be possible to automatically have it open to a new record when the form/subform first opens. Is there a way to do this?
     
  4. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    18,834
    Did you put the VBA code ONLY in the SUBFORM?
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/806366