"Select" from a module

jake7363

Registered User.
Local time
Yesterday, 19:16
Joined
Mar 14, 2005
Messages
46
Hi,
I am a bit confused where I went wrong....

In a form, I have 4 option buttons in a frame, named optLog. The Click Event is as follows:

Private Sub optLog_Click()
selLog
End Sub

In the module, the function selLog contains the following:

Select Case optLog
Case 1
DoCmd.OpenForm "frmAdvantagePlan"
Case 2
DoCmd.OpenForm "frmCMS_NGG"
Case 3
DoCmd.OpenForm "frmConsumerLife"
Case 4
DoCmd.OpenForm "frmNGGBksIDs"
End Select.


When I use the Click event in the form, nothing happens.

What did I miss?

Thanks in advance,
Jake
 
Use the After Update event of the Option Group.
 
your code should work

1. the frame is called optlog?

2. check the values of the checkboxes (s/b 1,2,3,4)

3. do you need a colon after yuor case statements
case1:
case2: etc
 
No need for colons in a Case statement. Not even sure if it will work with colons.

Anyway, is selLog really a function? If so, why? A function returns a value. A subroutine is what you want.
 
i realise whats going on now

why use the optlog click event (does this handle clicking the frame?/any check box etc?)

have a separate command button, and use that to test the value of optlog. Then your code will do what it should.
 
i realise whats going on now

why use the optlog click event (does this handle clicking the frame?/any check box etc?)

have a separate command button, and use that to test the value of optlog. Then your code will do what it should.

Again, I say - USE THE AFTER UPDATE event of the option group. When it fires you will have the value.
 

Users who are viewing this thread

Back
Top Bottom