Results 1 to 2 of 2
  1. #1
    jimmonator is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Location
    Portland, OR
    Posts
    26

    Add a new record to a subform?


    I have a form which contains a "Notes" subform, which is linked to a Notes table. The subform has the control bar turned off. I want to add a simple button which will add a record to the Notes Table and subform. I know how to get to the button's properties and the "event" tab, but I don't know what to write in the OnClick event procedure. All I need is a button which will make the new record and drop the cursor into position for a new note to be written. Can anyone help me with this?

  2. #2
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254

    jimmonator -

    Assuming the subform's recordsource is the Notes table or a query based on the Notes table -

    In the Buttons: OnClick event [EventProcedure], you could try:

    Dim strSubformControl As String
    strSubformControl = "NameofSubform"
    DoCmd.GoToControl strSubformControl
    DoCmd.GoToRecord acActiveDataObject, , acNewRec
    DoCmd.GoToControl "NameofNoteControl"


    All the best,

    Jim

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

Similar Threads

  1. Go To a New record in a subform of a subform
    By nomij in forum Programming
    Replies: 9
    Last Post: 09-21-2014, 11:23 AM
  2. Replies: 1
    Last Post: 03-15-2011, 03:53 PM
  3. Replies: 5
    Last Post: 06-29-2010, 01:24 PM
  4. new record is subform
    By Seven in forum Forms
    Replies: 5
    Last Post: 01-10-2010, 08:24 PM
  5. Subform add new record
    By ricardo9211 in forum Forms
    Replies: 0
    Last Post: 08-26-2009, 12:01 AM

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