Solved

Table Bound to a Form - MS Access

Posted on 2016-10-18
6
33 Views
Last Modified: 2016-10-20
I have an Access database with a bound form.   The form is used for adding records to a table. It has a bunch of textboxes and comboboxes on it for data entry. After the user enters required data into the boxes, (s)he clicks a command button to add a record.

Currently, when the form is opened, the boxes are populated with data from the first record in the table.  I do not want this.  I want all boxes to be empty upon opening/activating the form. How can I accomplish this?
0
Comment
Question by:dbfromnewjersey
  • 3
  • 2
6 Comments
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
Set the Form Data Entry property to Yes.
This will allow only adding New Records ...and open the Form to a blank, new record.
0
 

Author Comment

by:dbfromnewjersey
Comment Utility
But wait.  I'm going to be using the form to allow the user to scroll through already-entered records to update or delete them if they so choose. Your comment says setting it that way will only allow New Records.
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Access MVP) earned 500 total points
Comment Utility
Sorry ... I misread I guess.
So that will not work.

I guess you can do this:
In the Form Load event ....
Private Sub Form_Load()
    DoCmd.RunCommand acCmdRecordsGoToNew
End Sub
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:dbfromnewjersey
Comment Utility
Causes an error on the Load and Activate events but works on the Open event. I'll take it! Thanks.
0
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
Private Sub Form_Load()
    On Error Resume Next
    DoCmd.RunCommand acCmdRecordsGoToNew
    On Error Goto To 0  'reset
End Sub

You could ... put in more error handling here, but this covers the two cases above.
0
 
LVL 31

Expert Comment

by:Helen_Feddema
Comment Utility
Another option is to make a record with all blank values (or dummy values), if you can get the key field to be first in the order of the form's record source.  This can be useful if you have users who tend to open a form and start typing in it, without first selecting the appropriate record.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now