Multiple Choice Combo Box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello All,

I have a Combo box for birthdates that sends output to a report named
"Client Birthdate". What I would like to do is give the user a choice of
sending output to a Report or print output as labels.

Is is possible to have another Combo or List box appear after clicking the
first Combo Box with choices like "Send to report" and "Print as labels"? If
this isn't feasible any other suggestions are very welcome.

Here's the code from combo box named Birthdates:

Private Sub Birthdates_AfterUpdate()
DoCmd.OpenReport "Client Birthdate", acViewPreview
DoCmd.Maximize
RunCommand acCmdFitToWindow
Me.Birthdates = Null
End Sub
 
Sky said:
Hello All,

I have a Combo box for birthdates that sends output to a report named
"Client Birthdate". What I would like to do is give the user a choice
of sending output to a Report or print output as labels.

Is is possible to have another Combo or List box appear after
clicking the first Combo Box with choices like "Send to report" and
"Print as labels"? If this isn't feasible any other suggestions are
very welcome.

I'd use the wizard to create buttons that allowed the choice.
 
Hello All,

I have a Combo box for birthdates that sends output to a report named
"Client Birthdate". What I would like to do is give the user a choice of
sending output to a Report or print output as labels.

Is is possible to have another Combo or List box appear after clicking the
first Combo Box with choices like "Send to report" and "Print as labels"? If
this isn't feasible any other suggestions are very welcome.

Here's the code from combo box named Birthdates:

Private Sub Birthdates_AfterUpdate()
DoCmd.OpenReport "Client Birthdate", acViewPreview
DoCmd.Maximize
RunCommand acCmdFitToWindow
Me.Birthdates = Null
End Sub

Just add another control - a combo box or, perhaps better, a Listbox
or an Option Group - and reference it in the code. If you use an
Option Group (optReport) bear in mind that its value is a number -
choose 1 to be the Report and 2 to be the labels. Then use code like

Private Sub Birthdates_AfterUpdate()
Dim strRpt As String
Select Case Me!optReport
Case 1
strRpt = "Client Birthdate"
Case 2
strRpt = "Label Report"
End Select
DoCmd.OpenReport strRpt, acViewPreview
DoCmd.Maximize
RunCommand acCmdFitToWindow
Me.Birthdates = Null
End Sub


John W. Vinson[MVP]
 
John,

The option group worked perfectly, and it fits right in with the other
elements on the form. Man, I owe you dude. You saved me loads of grief
brother. And thanks for adding your code to my existing code, that really
helped a lot too :-)

-Sky
 
John,

The option group worked perfectly, and it fits right in with the other
elements on the form. Man, I owe you dude. You saved me loads of grief
brother. And thanks for adding your code to my existing code, that really
helped a lot too :-)

Glad to have been of assistance!

John W. Vinson[MVP]
 
Back
Top