M
Max Moor
Hi All,
I have a form with two subforms. The main form only has a combobox
for selecting which record to view. Two views of the data are possible, by
viewing one subform, and having the other be hidden.
Both subforms define their recordset by an SQL statement which is then
filtered to a single record when the main form's combobox is updates.
Finally, both subforms include a pair of text boxes that each display
a field in the record. These are enabled or not based on a yes/no that is
also in the datarecord. The code that updates them when subforms' yes/no
checkbox is changed is below.
What I really want is for the boxes to automatically enable or disable
themselves based on the yes/no's. I first tried doing this in the
OnCurrent event for the subforms. I got Write Conflict errors.
I thought, apparently incorrectly, that doing it in the OnCurrent
event was the problem. I added a Public wrapper function in the subforms'
modules, so I could call the update functions from the mainform combobox
update sub. Guess what? I still have Write Conflict erors.
Have I given enough info so that someone can explain this to me?
Thanks, Max
' This code enables or disables the salutaion textbox based
' on whether or not the users want to use the system generated
' salutaions or ones they define thewmselves.
Private Sub chkSalutationOverride_AfterUpdate()
If (Me!chkSalutationOverride = True) Then
Me!txtSalutation.Enabled = True
Else
Me!txtSalutation.Enabled = False
Me!txtSalutation = Me!FirstName
End If
End Sub
I have a form with two subforms. The main form only has a combobox
for selecting which record to view. Two views of the data are possible, by
viewing one subform, and having the other be hidden.
Both subforms define their recordset by an SQL statement which is then
filtered to a single record when the main form's combobox is updates.
Finally, both subforms include a pair of text boxes that each display
a field in the record. These are enabled or not based on a yes/no that is
also in the datarecord. The code that updates them when subforms' yes/no
checkbox is changed is below.
What I really want is for the boxes to automatically enable or disable
themselves based on the yes/no's. I first tried doing this in the
OnCurrent event for the subforms. I got Write Conflict errors.
I thought, apparently incorrectly, that doing it in the OnCurrent
event was the problem. I added a Public wrapper function in the subforms'
modules, so I could call the update functions from the mainform combobox
update sub. Guess what? I still have Write Conflict erors.
Have I given enough info so that someone can explain this to me?
Thanks, Max
' This code enables or disables the salutaion textbox based
' on whether or not the users want to use the system generated
' salutaions or ones they define thewmselves.
Private Sub chkSalutationOverride_AfterUpdate()
If (Me!chkSalutationOverride = True) Then
Me!txtSalutation.Enabled = True
Else
Me!txtSalutation.Enabled = False
Me!txtSalutation = Me!FirstName
End If
End Sub