data entry

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
 
K

KARL DEWEY

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.
 
L

Linq Adams via AccessMonster.com

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.
 
K

Klatuu

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
 
Top