J
John Fennell
I have changed the main form allow edits to no then I created a command
button with the following code to open the form for edits. The sub form
doesn't open. What lines of code must I enter to open the subform for
editing. Do I have to re write the code to make this happen. If so HELP.
Thanks for responding
Private Sub cmdEditRecord_Click()
Dim ctl As Control
Dim lngBackColor As Long
Me.AllowEdits = Not (Me.AllowEdits)
If Me.AllowEdits = True Then
Me!cmdEditRecord.Caption = "Lock"
lngBackColor = vbCyan
Else
Me!cmdEditRecord.Caption = "Edit Record"
lngBackColor = vbWhite
End If
For Each ctl In Me.Controls
If TypeOf ctl Is TextBox Or TypeOf ctl Is ComboBox Then
ctl.BackColor = lngBackColor
End If
Next ctl
'CurrentDate.SetFocus
End Sub
button with the following code to open the form for edits. The sub form
doesn't open. What lines of code must I enter to open the subform for
editing. Do I have to re write the code to make this happen. If so HELP.
Thanks for responding
Private Sub cmdEditRecord_Click()
Dim ctl As Control
Dim lngBackColor As Long
Me.AllowEdits = Not (Me.AllowEdits)
If Me.AllowEdits = True Then
Me!cmdEditRecord.Caption = "Lock"
lngBackColor = vbCyan
Else
Me!cmdEditRecord.Caption = "Edit Record"
lngBackColor = vbWhite
End If
For Each ctl In Me.Controls
If TypeOf ctl Is TextBox Or TypeOf ctl Is ComboBox Then
ctl.BackColor = lngBackColor
End If
Next ctl
'CurrentDate.SetFocus
End Sub