Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Select" from Module"

Status
Not open for further replies.

jake7363

Technical User
May 31, 2006
56
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
 
Tip: use the Option Explicit instruction.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi....


If you have your Select in a another module you have to pass the value of the frame.

Private Sub optLog_Click()
selLog(optLog.value)
End Sub



Public Function selLog(value)
Select Case value
Case 1
DoCmd.OpenForm "frmAdvantagePlan"
Case 2
DoCmd.OpenForm "frmCMS_NGG"
Case 3
DoCmd.OpenForm "frmConsumerLife"
Case 4
DoCmd.OpenForm "frmNGGBksIDs"
End Select.
End Function

Possibly better served leaving the Select in the click event

Hope this Helped........
 
Worked like a charm!!!
Thanks so much...

I think you are right about using it in the form, but I had to do it for all the forms, so I thought it might be a better idea...

But, I did learn something...

Much appreciated,
Jake
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top