Results 1 to 5 of 5
  1. #1
    sherik is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Apr 2013
    Posts
    3

    initializing forms


    Hi everyone. I am a novice in Access. So, could you please with the following problem. I have created a form which includes customer information and added a button which adds new customer. The problem is when I open the form, the form is already filled with one of the existing customer information, and when press button add button, the entries are cleared and then I am able to enter new customer info. What I want is when I open the form, it is cleared so that the entries are empty (empty name surname and so on), so I could directly enter new customer info. Thanks a lot.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Can set the form DataEntry property to Yes and then the form will open only to new record. Existing records will not be available for viewing.
    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
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Alternatively, you could put the following line in the form's On Open event. The existing records would then be available.
    DoCmd.GoToRecord , ,acNewRec
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  4. #4
    sherik is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Apr 2013
    Posts
    3
    Into VBA or where?

    Quote Originally Posted by Bob Fitz View Post
    Alternatively, you could put the following line in the form's On Open event. The existing records would then be available.
    DoCmd.GoToRecord , ,acNewRec

  5. #5
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    It would need to be in the forms code module and would look like:
    Code:
    Private Sub Form_Open(Cancel As Integer)
        
        DoCmd.GoToRecord , , acNewRec
    End Sub
    The forms On Open event property should be set to [Event Procedure]
    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: 5
    Last Post: 01-16-2013, 03:48 PM
  2. Multiple forms or embedded sub-forms
    By Juicejam in forum Forms
    Replies: 2
    Last Post: 08-23-2011, 07:31 AM
  3. Replies: 1
    Last Post: 01-04-2011, 05:04 AM
  4. Search forms and sub forms
    By FadingAPE in forum Forms
    Replies: 1
    Last Post: 12-15-2010, 01:59 PM
  5. Replies: 4
    Last Post: 04-01-2009, 08:49 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