Working on a small DB, one form has 4 combo boxes to pick information. This will be choices, in each combo, that the users adds from another form. So what I am trying to do is use the same form for each combo but changing the source.. Something like this... Should do that...
Public Sub sFormData(intOption As Integer)
Dim strRS As String 'strRS can be a Query or Table
DoCmd.OpenForm "frmTest" 'Change to your form
Select Case intOption
Case 1
strRS = "qry1"
Case 2
strRS = "qry2"
Case 3
strRS = "qry3"
End Select
Forms!frmTest.Form.RecordSource = strRS 'Change Form Name
End Sub
But... The problem is this doesn't change the recordsource of the 2 textboxes on the form. One the ID, one the description.
So when you open the form with say "option2" The texboxes still have the same source as they did in "Option1"
I know I can't be the first to use this...but can't locate any examples.
Public Sub sFormData(intOption As Integer)
Dim strRS As String 'strRS can be a Query or Table
DoCmd.OpenForm "frmTest" 'Change to your form
Select Case intOption
Case 1
strRS = "qry1"
Case 2
strRS = "qry2"
Case 3
strRS = "qry3"
End Select
Forms!frmTest.Form.RecordSource = strRS 'Change Form Name
End Sub
But... The problem is this doesn't change the recordsource of the 2 textboxes on the form. One the ID, one the description.
So when you open the form with say "option2" The texboxes still have the same source as they did in "Option1"
I know I can't be the first to use this...but can't locate any examples.