Results 1 to 4 of 4
  1. #1
    dave john is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    6

    Unhappy create a button to open a form for data entry

    i have this event procedure "DoCmd.OpenForm "FormName", , , "[PKID]=" & Me![PKID]" it opens a form base on the [PKID]to view the details, but my problem is when i click to an empty record (doesnt have PKID yet) to enter a new record it returns an error message.... any idea please......

    and thanks....

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Try:
    DoCmd.OpenForm "FormName", , , "[PKID]=" & Me![PKID], , , Me![PKID]
    Then in the forms Before Update event:
    Me![PKID] = Me.OpenArgs
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    dave john is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    6
    thanks a lot Bob....
    i had another question, can you recommend any book or video tutorial on how to create macros or vba for access???
    goodluck and Godbless

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Quote Originally Posted by dave john View Post
    thanks a lot Bob....
    i had another question, can you recommend any book or video tutorial on how to create macros or vba for access???
    goodluck and Godbless
    Glad you got it working.
    As I use A2003 I don't feel I could recommend any books on A2010.
    I'm sure that if you google "ms access tutorial" you will find plenty to get you going.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

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

Similar Threads

  1. Replies: 6
    Last Post: 10-22-2022, 08:27 AM
  2. how to create data entry form using query
    By dave john in forum Programming
    Replies: 1
    Last Post: 08-21-2012, 06:00 AM
  3. Open report from data entry form
    By pbuecken in forum Forms
    Replies: 5
    Last Post: 01-14-2012, 12:07 PM
  4. Replies: 5
    Last Post: 03-03-2011, 03:56 PM
  5. Replies: 7
    Last Post: 01-12-2011, 01:41 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