data entry

  • Thread starter Thread starter Rafi
  • Start date Start date
R

Rafi

I have 4 controls on a form which are used for data entry. How can I make
sure they point to a new record when I open the form? At present, each of
the controls displays the data from the last record
 
Set the Data Entry property to Yes. It will open to a new record but you
will not be able to edit existing records using this form.

Alternative you can have On Open event to call a macro. Have that marco
action go to new record. This means there will be a new record, even if you
do not want one each time the form is opened.
 
Following Karl's idea

Private Sub Form_Load()
DoCmd.GoToRecord , , acNewRec
End Sub

As he said, it'll open the form to a new record, but also allow you to view
existing records.
 
You can set the DataEntry property in code. I would suggest a command button
that will change it as needed from either Add to Edit, where Add goes into
data entry mode and edit goes into normal edit mode:

Private Sub Command4_Click()
If Me.DataEntry = True Then
Me.DataEntry = False
Me.Command4.Caption = "Add"
Else
Me.DataEntry = True
Me.Command4.Caption = "edit"
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top