L
LeLe
I have created an order entry form which contains a sub form for line item
entry. The properties for allow filters, edits, additions, deletions, are
all set to yes. When I first open the form, I am presented with the first
order placed in the application. When I click the arrow at the bottom of the
form for a new record, a blank order form complete with the sub form for line
item entry appears.
I want to change the form so when the user first opens the form, the allow
edits feature is set to No. I have created a button to do this and it works
fine. Here is the code.
Private Sub EditRecordBut_Click()
Me.AllowEdits = True 'Allow changes on the Order form
Forms![Orderentry]![LineItemOrderEntry].Form.AllowEdits = True ' Allow
changes on the line item subform
CustomerName.SetFocus 'Move the focus to the first field
End Sub
My problem is when I try to add a record. If I click on the arrow at the
bottom of the form, a new order form is created, but there is no line item
sub form. That area of the form is totally blank. Based on my observations,
I created the following code but it didn’t solve my problem. Any help is
greatly appreciated.
Private Sub AddRecLab_Click()
On Error GoTo Err_AddRecLab_Click
Me.AllowEdits = True
Forms![Orderentry]![LineItemOrderEntry].Form.AllowEdits = True
DoCmd.GoToRecord , , acNewRec
CustomerName.SetFocus
Exit_AddRecLab_Click:
Exit Sub
Err_AddRecLab_Click:
MsgBox Err.Description
Resume Exit_AddRecLab_Click
End Sub
entry. The properties for allow filters, edits, additions, deletions, are
all set to yes. When I first open the form, I am presented with the first
order placed in the application. When I click the arrow at the bottom of the
form for a new record, a blank order form complete with the sub form for line
item entry appears.
I want to change the form so when the user first opens the form, the allow
edits feature is set to No. I have created a button to do this and it works
fine. Here is the code.
Private Sub EditRecordBut_Click()
Me.AllowEdits = True 'Allow changes on the Order form
Forms![Orderentry]![LineItemOrderEntry].Form.AllowEdits = True ' Allow
changes on the line item subform
CustomerName.SetFocus 'Move the focus to the first field
End Sub
My problem is when I try to add a record. If I click on the arrow at the
bottom of the form, a new order form is created, but there is no line item
sub form. That area of the form is totally blank. Based on my observations,
I created the following code but it didn’t solve my problem. Any help is
greatly appreciated.
Private Sub AddRecLab_Click()
On Error GoTo Err_AddRecLab_Click
Me.AllowEdits = True
Forms![Orderentry]![LineItemOrderEntry].Form.AllowEdits = True
DoCmd.GoToRecord , , acNewRec
CustomerName.SetFocus
Exit_AddRecLab_Click:
Exit Sub
Err_AddRecLab_Click:
MsgBox Err.Description
Resume Exit_AddRecLab_Click
End Sub