Greetings,
I'm working with an unbound form and two option groups. The first option group, optReport, has two option buttons, stored values are 1 or 2. The second option group, optSend, has three options, stored values are 1, 2, and 3.
The default value for optReport and optSend is 1.
Finally, there is a command button to execute the following code:
All I want to do is ask the user which report they want to send, Option A or B, and how they want it done (Preview, normal, or email)
It works perfectly until I choose Option B (where optReport should = 2). When I do, it still acts as if optReport = 1 and pulls rptOptionA. Any ideas?
(This is my first time working with SELECT CASE clauses so I'm sure the mistake(s) is/are in there. Thank you in advance!
~Melagan
______
"It's never too late to become what you might have been.
I'm working with an unbound form and two option groups. The first option group, optReport, has two option buttons, stored values are 1 or 2. The second option group, optSend, has three options, stored values are 1, 2, and 3.
The default value for optReport and optSend is 1.
Finally, there is a command button to execute the following code:
Code:
Private Sub cmdOK_Click()
Dim strReport As String
Select Case optReport
Case 1
strReport = "rptOptionA"
Case 2
strReport = "rptOptionB"
Case Else
Debug.Print "Please choose a report."
End Select
If optSend = 1 Then
DoCmd.OpenReport strReport, acViewPreview
ElseIf optSend = 2 Then
DoCmd.OpenReport strReport, acViewNormal
'I havn't written the sendobject.email procedure yet.
ElseIf optSend = 3 Then
MsgBox "Email Procedure to follow", vbOKOnly, "Email"
End If
End Sub
All I want to do is ask the user which report they want to send, Option A or B, and how they want it done (Preview, normal, or email)
It works perfectly until I choose Option B (where optReport should = 2). When I do, it still acts as if optReport = 1 and pulls rptOptionA. Any ideas?
(This is my first time working with SELECT CASE clauses so I'm sure the mistake(s) is/are in there. Thank you in advance!
~Melagan
______
"It's never too late to become what you might have been.