Results 1 to 4 of 4
  1. #1
    coolpal9 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2012
    Posts
    40

    Add new record in VBA

    Hi,



    I have a database wherein I have a detailed form to be filled up so that the data provided is automatically updated in the tables in the backend.

    But I wanted to ask, when I wish to add more records, how shall I make it go through the code?

    What shall i code so that a new record is added and also where shall I place the code, I mean in the form of a module or just a code for a click event.

    Also, I read somewhere that using:
    DoCmd.GoToRecord,,acNewrRec in the click() event would work it, but I got an error on doing so...

    Pl help...

  2. #2
    pdebaets is offline Competent Performer
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Los Angeles
    Posts
    235
    what is the error message?

  3. #3
    coolpal9 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2012
    Posts
    40
    The error is:

    'You can't use GoToRecord action or method on an object in Design View'

  4. #4
    pdebaets is offline Competent Performer
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Los Angeles
    Posts
    235
    Is the button on the "detailed" form, or on another form? Make sure the "detailed" form is open in form view, then try it again.

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

Similar Threads

  1. Replies: 8
    Last Post: 07-06-2013, 05:13 PM
  2. Creating unique record from record and field data
    By arthurpenske in forum Access
    Replies: 3
    Last Post: 08-24-2011, 06:11 PM
  3. Replies: 4
    Last Post: 07-22-2011, 12:52 PM
  4. Replies: 7
    Last Post: 12-15-2010, 09:46 AM
  5. Replies: 5
    Last Post: 06-29-2010, 01:24 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