Results 1 to 3 of 3
  1. #1
    MarcoRed is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2012
    Location
    Cambodia
    Posts
    8

    Creating "New" Button using VBA in MS Access??

    Most of the time I try to create "New" button using VBA (cmdaddnew). But most of them are always unsuccessful and still can't solve the problems.

    The thing is: I have already created a "New" Button (I think i used the right code) and click on it to create a new record, but After clicking on it an Error come out::
    Microsoft Visual Basic
    Run-time error '3061':
    Too few parameters. Expected 1.



    I have created many project using VBA, 90% of them are like this.

    Plz provide me more info about VBA and MS Access, I'm a Beginner.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    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
    As June7 said, we can only analyze code that we can see, but this task is really very basic:

    Code:
    Private Sub cmdAddNew_Click()
      DoCmd.GoToRecord , , acNewRec
    End Sub

    Linq ;0)>
    Last edited by Missinglinq; 09-17-2012 at 06:57 PM.

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

Similar Threads

  1. Replies: 11
    Last Post: 03-29-2012, 02:32 PM
  2. Replies: 2
    Last Post: 02-21-2012, 01:35 PM
  3. Replies: 0
    Last Post: 01-11-2012, 12:34 PM
  4. Replies: 2
    Last Post: 11-04-2011, 02:45 AM
  5. Replies: 3
    Last Post: 02-23-2010, 06:32 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