Link to home
Create AccountLog in
Avatar of Frank Freese
Frank FreeseFlag for United States of America

asked on

option group default

Experts,
I have an option group (check boxes) that has no default value. When I select an item within the option group a pop-up form is displayed. After I close the pop-up I'd like to reset the option group back to the default of none or disable that option all together (not sure which direction I want to go)
ASKER CERTIFIED SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Or you can set it to a non-existent Option Value ...

mx
Avatar of Frank Freese

ASKER

Here's the code I put in my close event. It looks to be working?
Private Sub cmdClose_Click()
On Error GoTo Err_cmdClose_Click

If Me.Dirty Then
    Me.Undo
    End If
    Forms!frmPreliminaryBonus.OptSelectEmployee = Null
    DoCmd.Close

Exit_cmdClose_Click:
    Exit Sub

Err_cmdClose_Click:
    MsgBox Err.Description
    Resume Exit_cmdClose_Click
    
End Sub

Open in new window

OK with that?
Humm ... but if it's in the Close event, it's all after the fact.  Next time it opens, it should be with no option selected ....

Or ... is frmPreliminaryBonus a different Form that is closing ?

mx
the form that isi closing is frmAdjustmentsToBonus that has a command button called cmdClose. After I close this pop-up form it "should" resent the option group in the main form frmPremliminaryBonus.
ok ... then is seems that would be correct.  Is it working ?

mx
yes - just wanted an affirmation
mx's solution was easy to follow and implement - he also affirmed that my code was correct.
thanks mx - appreciate all the experts