brainstorms
Technical User
Hello,
I have one form, and would like it be opened with a different recordsource according to a selection by users via another form.
This code works fine to open the form, with the form recordsource being the query "qclosed":
' openforms_allclosedadult
Function openforms_allclosedadult()
On Error GoTo openforms_allclosedadult_Err
DoCmd.OpenForm "cases", acNormal, "", "[qclosed]![age]=""A""And [qcclosed]![adv] = 0 ", , acNormal
Forms!Cases.nowshowing.Visible = True
Forms!Cases.nowshowing.Caption = "Records selected: Adult, All, Closed, Excl. Advocacy"
openforms_allclosedadult_Exit:
Exit Function
openforms_allclosedadult_Err:
MsgBox Error$
Resume openforms_allclosedadult_Exit
End Function
How can I change code this to force the form to use a different query?
Any help much appreciated with this urgent problem!
I have one form, and would like it be opened with a different recordsource according to a selection by users via another form.
This code works fine to open the form, with the form recordsource being the query "qclosed":
' openforms_allclosedadult
Function openforms_allclosedadult()
On Error GoTo openforms_allclosedadult_Err
DoCmd.OpenForm "cases", acNormal, "", "[qclosed]![age]=""A""And [qcclosed]![adv] = 0 ", , acNormal
Forms!Cases.nowshowing.Visible = True
Forms!Cases.nowshowing.Caption = "Records selected: Adult, All, Closed, Excl. Advocacy"
openforms_allclosedadult_Exit:
Exit Function
openforms_allclosedadult_Err:
MsgBox Error$
Resume openforms_allclosedadult_Exit
End Function
How can I change code this to force the form to use a different query?
Any help much appreciated with this urgent problem!