D
desgordon
I am creating an application with a parent form and a subform that contains a
datasheet. When a button on the main form is clicked I want to initialize
certain fields on a new record in the datasheet then set the focus to the
next field. I use the following code:
Private Sub NEW_BUILDING_OPTIONS_Click()
HH_Subform.Controls.Item(6).DefaultValue = ""
HH_Subform.Controls.Item(8).DefaultValue = 25
HH_Subform.Controls.Item(10).DefaultValue = 75
HH_Subform.Controls.Item(12).SetFocus
End Sub
The first three lines does what I want it to do i.e. initialize some fields
of a new record to some values I want. The other line however sets the focus
on the correct field, but on the first record of the recordset and not on the
new record as I want.
Can somebody help with this?
datasheet. When a button on the main form is clicked I want to initialize
certain fields on a new record in the datasheet then set the focus to the
next field. I use the following code:
Private Sub NEW_BUILDING_OPTIONS_Click()
HH_Subform.Controls.Item(6).DefaultValue = ""
HH_Subform.Controls.Item(8).DefaultValue = 25
HH_Subform.Controls.Item(10).DefaultValue = 75
HH_Subform.Controls.Item(12).SetFocus
End Sub
The first three lines does what I want it to do i.e. initialize some fields
of a new record to some values I want. The other line however sets the focus
on the correct field, but on the first record of the recordset and not on the
new record as I want.
Can somebody help with this?