G
Guest
Hi,
I have four combo boxes in an access form. Users will select one item from
each of the four combo boxes. Based on the choices the selection criteria
will be used for further processing. However, I need to get the user selected
values from each of the combo box and stuff them to variables. I have the
following code just to do that. However, it is not working. Any help is
appreciated. Thanks
CODE:
Option Compare Database
Private Sub cboBusinessUnit_AfterUpdate()
strMarketChannel = Me.cboBusinessUnit.Text
End Sub
Private Sub cboGLPeriod_AfterUpdate()
strGLPeriod = Me.cboGLPeriod.Text
End Sub
Private Sub cboTbsGroup_AfterUpdate()
strTBSGroup = Me.cboTbsGroup.Text
End Sub
Private Sub cboTBSYear_AfterUpdate()
strGLYear = Me.cboTBSYear.Text
End Sub
Private Sub cmdSearchNow_Click()
MsgBox ("Procedure complete. Records selected" & vbCrLf & _
"Parameter 1: " & strMarketChannel & vbCrLf & "Parameter 2: " &
strTBSGroup & vbCrLf & "Parameter 3: " & strGLPeriod & vbCrLf & "Parameter
4: " & strGLYear)
'DoCmd.OpenForm "frmResults", acFormDS
End Sub
I have four combo boxes in an access form. Users will select one item from
each of the four combo boxes. Based on the choices the selection criteria
will be used for further processing. However, I need to get the user selected
values from each of the combo box and stuff them to variables. I have the
following code just to do that. However, it is not working. Any help is
appreciated. Thanks
CODE:
Option Compare Database
Private Sub cboBusinessUnit_AfterUpdate()
strMarketChannel = Me.cboBusinessUnit.Text
End Sub
Private Sub cboGLPeriod_AfterUpdate()
strGLPeriod = Me.cboGLPeriod.Text
End Sub
Private Sub cboTbsGroup_AfterUpdate()
strTBSGroup = Me.cboTbsGroup.Text
End Sub
Private Sub cboTBSYear_AfterUpdate()
strGLYear = Me.cboTBSYear.Text
End Sub
Private Sub cmdSearchNow_Click()
MsgBox ("Procedure complete. Records selected" & vbCrLf & _
"Parameter 1: " & strMarketChannel & vbCrLf & "Parameter 2: " &
strTBSGroup & vbCrLf & "Parameter 3: " & strGLPeriod & vbCrLf & "Parameter
4: " & strGLYear)
'DoCmd.OpenForm "frmResults", acFormDS
End Sub