Endojoe
Registered User.
- Local time
- Today, 08:34
- Joined
- Apr 7, 2009
- Messages
- 20
I have a form with 4 Option Groups, and I need to guide the user through the selection process in a step by step manner. I have tried using some VB code to set the Option Groups to invisible, then make them visable again after a selection is made in each group, in the order they need to be selected in, but this only works when I create a new record, most likely because I'm using the 'On Current' event to fire the code...but when I try to put it anywhere else it won't work at all...the code...
Now...these Option Groups have been added to an existing form thats attached to a table with well over 6000 records that were not created using the option groups, my goal is to be able to use this code to walk the user through the Option Group selection process on existing records when it becomes necessary. But I can't seem to figure out what Event to use, I've tried all of them that seem logical to me.
When the form loads, all Option Groups are visible until I go to create a new record, then they disappear as the code instructs them to, and they stay gone as I move back through records that have not had any selections made, but as soon as I pass through a record that has had selections made, all option groups re-appear and they stay visible even when I go to records that have no selections made again...I'm baffled... Any thoughts or suggestions on how to make this work how I want it to? Or any better ideas on how to achieve what I'm aiming for would be welcomed! Thanks.
Code:
Private Sub Form_Current()
If Me.opt_Export_Domestic = 0 Then
Me.opt_Cert_Type.Visible = False
Me.opt_Assy_SubAssy.Visible = False
Me.opt_PMA_ASSY.Visible = False
ElseIf Me.opt_Export_Domestic = 1 Then
Me.opt_Cert_Type.Visible = True
Me.opt_Assy_SubAssy.Visible = True
Me.opt_PMA_ASSY.Visible = True
ElseIf Me.opt_Export_Domestic = 2 Then
Me.opt_Cert_Type.Visible = True
Me.opt_Assy_SubAssy.Visible = True
Me.opt_PMA_ASSY.Visible = True
ElseIf Me.opt_Export_Domestic = 3 Then
Me.opt_Cert_Type.Visible = True
Me.opt_Assy_SubAssy.Visible = True
Me.opt_PMA_ASSY.Visible = True
End If
ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.DESCRIPTION, _
vbCritical, "Error in procedure Form_Current..."
Resume ExitProc
End Sub
Now...these Option Groups have been added to an existing form thats attached to a table with well over 6000 records that were not created using the option groups, my goal is to be able to use this code to walk the user through the Option Group selection process on existing records when it becomes necessary. But I can't seem to figure out what Event to use, I've tried all of them that seem logical to me.
When the form loads, all Option Groups are visible until I go to create a new record, then they disappear as the code instructs them to, and they stay gone as I move back through records that have not had any selections made, but as soon as I pass through a record that has had selections made, all option groups re-appear and they stay visible even when I go to records that have no selections made again...I'm baffled... Any thoughts or suggestions on how to make this work how I want it to? Or any better ideas on how to achieve what I'm aiming for would be welcomed! Thanks.