Solved

Table Bound to a Form - MS Access

Posted on 2016-10-18
6
122 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 75
ID: 41849036
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
ID: 41849078
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 - Microsoft MVP, Access and Data Platform) earned 500 total points
ID: 41849097
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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

Author Comment

by:dbfromnewjersey
ID: 41850281
Causes an error on the Load and Activate events but works on the Open event. I'll take it! Thanks.
0
 
LVL 75
ID: 41850615
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
ID: 41852428
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

630 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