AbacusInfoTech
asked on
Set a subforms allowadditions property based on a value in a form
I want to set the allowadditions property of [frmSubForm] to FALSE if a value of a combo [mycombo] in the parent form [frmMain] is "Ordered"
If the user changes this combo (to "Not Ordered") then the allowadditions property gets re set to TRUE.
If the user changes the combo (back to "Ordered") then the allowadditions property gets re set to FALSE.
If the user changes this combo (to "Not Ordered") then the allowadditions property gets re set to TRUE.
If the user changes the combo (back to "Ordered") then the allowadditions property gets re set to FALSE.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Glad to help out :-)
I'm suprised you needed the ".Value". I use the exact syntax I posted routinely. I use access 2003 where ".value" is the default property. Your question tags state Access 2000. I wonder if that accounts for the difference?
I'm suprised you needed the ".Value". I use the exact syntax I posted routinely. I use access 2003 where ".value" is the default property. Your question tags state Access 2000. I wonder if that accounts for the difference?
ASKER
I am using 2000... and I tried without .value so I guess 2003 may be different.
ASKER
Just had to tweak:
Private Sub MyCombo_AfterUpdate()
If me.MyCombo.Value = "Ordered" THEN Me.frmSubform.form.AllowAd
If me.MyCombo.Value = "Not Ordered" THEN Me.frmSubform.form.AllowAd
End sub