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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling a procedure from a combo box.

Status
Not open for further replies.

Zepher2

Technical User
Dec 29, 2001
25
US
I am using my database to open Word files from a template and fill in the various Word fields. For each word file I have a command button to call the procedure for that file. As my list of Word documents grows, I am accumulating many buttons on my form.

I would like to create a drop down list and call each procedure when selected from the list. I don't have a clue on how to do this as my coding experienceis very limited.

Can anyone help? Thanks in advance
 
Put the code in the AfterUpdate Event of the Combobox.
Maybe an If...Then or Case structure?
 
That's where i have the difficulty. I don't know the code to call the subroutine. I can write the combo box so that it stores the name of the procedure in a field, but I don't know where to go from there.

Any suggestions on the code? I am not a programmer so I am easily confused.
 
Something like:

Code:
Private Sub Combo_AfterUpdate()

Dim strCombo As String

strCombo = Me!ComboBoxName

Select Case strCombo

Case "Value1"

Call SubroutineName1

Case "Value2"

Call SubroutineName2

End Select
End Sub

Does that look like it might help?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top