How to get form to display blank record

  • Thread starter Thread starter Pat_Garner
  • Start date Start date
P

Pat_Garner

Guest
Thank you in advance for all of your help regarding this matter. In addition, please excuse the elementary nature of my question, but I am just diving into the capbiliities of Access.

I'm trying to make it so that when my form opens, it displays blank controls ready for input of new and fresh information. I don't want the user to have to mess with the navigation buttons in order to get to a blank record for new information input.

Currently, the form displays the last record modified. At first, I thought I could solve this with one of the 'recordset' functions, but as usual I was mistaken.

Does anybody have any suggestions? Your help is greatly appreciated by this entry-level recent grad.

-Pat
 
In the form's OnLoad sub place the following code:

DoCmd.GoToRecord , , acNewRec

Too make it really convenient for your users you might want to also set the focus on the first field in the form.

FirstField.SetFocus
(Replace "FirstField" with the actual name of your first field)

Hope this helps.

The Missinglinq
 
Hi Pat_Garner,

Suggestion from missinglinq you can use if your are very familiar with VB but another solution you can do like these;

1. Get you form on Design View.
2. Get you form property, then Go To Data Tab.
3. On Data Entry, select No to Yes.
4. Get you form view, then you form will be open on blank form once the form start.

Thats all. hopefully can help you.

Best regards.
 
Thank you for all of your help. Its the little things like this that make users lives easier and help me make a good impression.

-Pat
 
Alternatively.........

I always like to use unbound forms for adding data to tables

e.g.


Create a form with the field names to correspond to your table (the fields being Unbound).

Create an Add Button with the following code:


___________________________________________________



Private Sub Add_Click()
On Error GoTo Err_Add_Click

Dim MyDb As DATABASE
Dim CallTable As Recordset





Set MyDb = DBEngine.Workspaces(0).Databases(0)
Set CallTable = MyDb.OpenRecordset("tblTable", DB_OPEN_DYNASET)

CallTable.AddNew
CallTable![Field1] = Me![Field1]
CallTable![Field2] = Me![Field2]
CallTable![Field3] = Me![Field3]
CallTable.Update
CallTable.Close



DoCmd.Close

Exit_Add_Click:
Exit Sub

Err_Add_Click:
MsgBox Err.Description
Resume Exit_Add_Click

End Sub



____________________________________________________


Hope that helps
 

Users who are viewing this thread

Back
Top Bottom