Another Form Question

C

Chip

I am new to Access and VB so please be gentle. I am tring to open a form
with a button but i want the new form to be ready for a new record instead
of the first record but setting DataEntry to Yes is causing some problems
since i want the person to be able to navigate to other records from the new
form and Data Entry = Yes does not allow that. Any ideas?

As Always, THANKS IN ADVANCE!!!

Chip
 
F

fredg

I am new to Access and VB so please be gentle. I am tring to open a form
with a button but i want the new form to be ready for a new record instead
of the first record but setting DataEntry to Yes is causing some problems
since i want the person to be able to navigate to other records from the new
form and Data Entry = Yes does not allow that. Any ideas?

As Always, THANKS IN ADVANCE!!!

Chip

Code the command button that will open the new form:
DoCmd.OpenForm "FormName", , , , , , "GoToNew"

Code the Load event of the form that is being opened:
If Me.OpenArgs = "GoToNew" Then
Docmd.RunCommand acCmdRecordsGoToNew
End If

This has the advantage of allowing the form to be opened normally, at
the first record, except if opened from that other form.
 
M

Mark

For the form you want to open to a new record, go into design view and open
the properties window. Select the "Events" tab, and find the "On Open"
event. Choose [Event Procedure] and then the "..." to go to the code
builder. Paste the following code which will move your form to a new record
each time the form is first opened:

DoCmd.GoToRecord , , acNewRec
 
Top