N
NEWER USER
I am having some difficulty geeting the RecordSet property to work. I am
trying to use ONE form to display records differently rather than creating
separate forms and subforms. My form is titled frmGrouping and has its
RecordSet as qryGrouping. I want to change the Recordset to
"qryProductGrpPads" when the form opens. The only difference in the two
queries is one table that I build prior to opening the form. I have the
following code attached to a Command button on a Form used to call the form.
On Error GoTo Err_Alternates_Click
Dim strDoc As String
Dim strDoc1 As String
Dim strDoc2 As String
strDoc = "qryMakeTableGrpPads"
strDoc1 = "frmGrouping"
strDoc2 = "qryProductGrpPads"
DoCmd.SetWarnings False
DoCmd.OpenQuery strDoc, acNormal, acEdit
DoCmd.OpenForm strDoc1, acNormal, "", "", , acNormal
Me.RecordSource = strDoc2
DoCmd.SetWarnings True
Exit_Alternates_Click:
Exit Sub
Err_Alternates_Click:
MsgBox Err.Description
Resume Exit_Alternates_Click
The form is opening BLANK; The Recordset is not substituing in place of the
one defined in the form properties. Any help appreciated.
trying to use ONE form to display records differently rather than creating
separate forms and subforms. My form is titled frmGrouping and has its
RecordSet as qryGrouping. I want to change the Recordset to
"qryProductGrpPads" when the form opens. The only difference in the two
queries is one table that I build prior to opening the form. I have the
following code attached to a Command button on a Form used to call the form.
On Error GoTo Err_Alternates_Click
Dim strDoc As String
Dim strDoc1 As String
Dim strDoc2 As String
strDoc = "qryMakeTableGrpPads"
strDoc1 = "frmGrouping"
strDoc2 = "qryProductGrpPads"
DoCmd.SetWarnings False
DoCmd.OpenQuery strDoc, acNormal, acEdit
DoCmd.OpenForm strDoc1, acNormal, "", "", , acNormal
Me.RecordSource = strDoc2
DoCmd.SetWarnings True
Exit_Alternates_Click:
Exit Sub
Err_Alternates_Click:
MsgBox Err.Description
Resume Exit_Alternates_Click
The form is opening BLANK; The Recordset is not substituing in place of the
one defined in the form properties. Any help appreciated.