Hello
I have a question pertaining to MS Access 2010 and creating a search form. I have a search form that I created. I have 2 combo boxes. If I select a value from one combo box those values are displayed in the table on the form. Then, if I select a value from the 2nd combo box, those values are displayed in the table but resetting it to where the 1st combo box is not being used
I wanted to know how I can have both of the combo boxes working together. I can post the code that I have if this helps.
Im not much of a programmer but I can usually figure out how to manipulate code from tutorials but this one is confusing me. Is there a command that will make the 2 work together? I see that I have both ending with: Me.Qry_RAU_PLAN_TOTALS_subform.Form.Requery, so perhaps the Requery is resetting the value from the 1st combo box
Any help is much appreciative
ption Compare Database
'--------------------------------------------------------------------------------------------------------------------
'The code below allows one to chose a value from a combo box and only have those values displayed in the query/table
'--------------------------------------------------------------------------------------------------------------------
Private Sub cboPlanType_AfterUpdate()
Dim myPlanType As String
myPlanType = "Select * From Qry_RAU_PLAN_TOTALS where ([PLAN_TYPE_CODE] ='" & Me.CboPLANTYPE & "')"
Me.Qry_RAU_PLAN_TOTALS_subform.Form.RecordSource = myPlanType
Me.Qry_RAU_PLAN_TOTALS_subform.Form.Requery
End Sub
'The code below is set up for a combobox, one would chose a review name, and it will display those reviews
'--------------------------------------------------------------------------------------------------------------------
Private Sub cboReviewType_AfterUpdate()
Dim myReviewType As String
myReviewType = "Select * From Qry_RAU_PLAN_TOTALS where ([REVIEW_NAME] ='" & Me.cboReviewType & "')"
Me.Qry_RAU_PLAN_TOTALS_subform.Form.RecordSource = myReviewType
Me.Qry_RAU_PLAN_TOTALS_subform.Form.Requery
End Sub