Solved

Table Bound to a Form - MS Access

Posted on 2016-10-18
6
72 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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…

761 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