G
Guest
Can anyone explain why I am getting the following error from the following
code? (the code looks long but it's there to give context; I've marked the
line which I think is causing the error)
error: "You entered an expression that has an invalid reference to the
property Form/Report."
code:
'construct recordsource for subform based on choice made in combobox
'first combobox value being used in filter is written to txtHiddenCourseID
since it is not the bound column of the combobox
strSQL = "SELECT tblFeedbackCollection.idFeedbackNumber, Left([screenID],3)
AS FirstThree, tblFeedbackCollection.screenID,
tblFeedbackCollection.dateSubmitted, tblFeedbackCollection.teamMember,
tblFeedbackCollection.status, tblFeedbackCollection.dateCompleted,
tblFeedbackCollection.type, tblFeedbackCollection.topic,
tblFeedbackCollection.feedback, tblFeedbackCollection.phase,
tblFeedbackCollection.idComments, tblFeedbackCollection.transientSelect FROM
tblFeedbackCollection WHERE (((Left([screenID],3))='" & [txtHiddenCourseID] &
"') AND ((tblFeedbackCollection.dateSubmitted) Between #" & [dteStartDate] &
"# And #" & [dteEndDate] & "#) AND ((tblFeedbackCollection.status)='" &
[cboStatusFilter] & "') AND ((tblFeedbackCollection.phase)='" &
[cboPhaseFilter] & "'));"
'**** the next line is producing the error, I think
Forms!frmFilterChoice!frmFirstFilter_datasheet.Form.RecordSource = strSQL
Forms!frmFilterChoice!frmFirstFilter_datasheet.Requery
Me.Detail.Visible = True
Me.FormHeader.Visible = False
code? (the code looks long but it's there to give context; I've marked the
line which I think is causing the error)
error: "You entered an expression that has an invalid reference to the
property Form/Report."
code:
'construct recordsource for subform based on choice made in combobox
'first combobox value being used in filter is written to txtHiddenCourseID
since it is not the bound column of the combobox
strSQL = "SELECT tblFeedbackCollection.idFeedbackNumber, Left([screenID],3)
AS FirstThree, tblFeedbackCollection.screenID,
tblFeedbackCollection.dateSubmitted, tblFeedbackCollection.teamMember,
tblFeedbackCollection.status, tblFeedbackCollection.dateCompleted,
tblFeedbackCollection.type, tblFeedbackCollection.topic,
tblFeedbackCollection.feedback, tblFeedbackCollection.phase,
tblFeedbackCollection.idComments, tblFeedbackCollection.transientSelect FROM
tblFeedbackCollection WHERE (((Left([screenID],3))='" & [txtHiddenCourseID] &
"') AND ((tblFeedbackCollection.dateSubmitted) Between #" & [dteStartDate] &
"# And #" & [dteEndDate] & "#) AND ((tblFeedbackCollection.status)='" &
[cboStatusFilter] & "') AND ((tblFeedbackCollection.phase)='" &
[cboPhaseFilter] & "'));"
'**** the next line is producing the error, I think
Forms!frmFilterChoice!frmFirstFilter_datasheet.Form.RecordSource = strSQL
Forms!frmFilterChoice!frmFirstFilter_datasheet.Requery
Me.Detail.Visible = True
Me.FormHeader.Visible = False