G
Guest
I am trying to open a form in hidden mode, assign the record source
programmatically, and make the form visible but in _datasheet view. Access
will not open the form in datasheet view (I get a "You can't assign a value
to this object." error). The Default View and Views Allowed properties of
the form I'm trying to open are both set to Datasheet; but the form will only
open in Single Form view. (I have tried opening the form as a subform but am
using this code now because Access refuses to accept the code
Forms!frmFilterChoice!frmSecondFilter.Form.RecordSource = strSQL)
My code:
strSQL = "SELECT tblFeedbackCollection.idFeedbackNumber, Left([screenID],3)
AS FirstThree, tblFeedbackCollection.screenID,
tblFeedbackCollection.dateSubmitted, tblFeedbackCollection.teamMember,
tblFeedbackCollection.status, tblFeedbackCollection.startDate,
tblFeedbackCollection.endDate, tblFeedbackCollection.type,
tblFeedbackCollection.topic, tblFeedbackCollection.feedback,
tblFeedbackCollection.phase, tblFeedbackCollection.idtComments,
tblFeedbackCollection.transientSelect FROM tblFeedbackCollection WHERE
(((Left([screenID],3))='" & strCourseID & "') AND
((tblFeedbackCollection.dateSubmitted) Between #" & datStartDate & "# And #"
& datEndDate & "#) AND ((tblFeedbackCollection.status)='" & strStatus & "')
AND ((tblFeedbackCollection.phase)='" & strPhase & "'));"
'open form to be filtered
DoCmd.OpenForm "frmSecondFilter", acNormal, , , acFormPropertySettings,
acHidden
'assign recordsource
Forms!frmSecondFilter.RecordSource = strSQL
'make sure view is datasheet
'Forms!frmSecondFilter.ViewsAllowed = datasheet
'make form visible
Forms!frmSecondFilter.Visible = True
programmatically, and make the form visible but in _datasheet view. Access
will not open the form in datasheet view (I get a "You can't assign a value
to this object." error). The Default View and Views Allowed properties of
the form I'm trying to open are both set to Datasheet; but the form will only
open in Single Form view. (I have tried opening the form as a subform but am
using this code now because Access refuses to accept the code
Forms!frmFilterChoice!frmSecondFilter.Form.RecordSource = strSQL)
My code:
strSQL = "SELECT tblFeedbackCollection.idFeedbackNumber, Left([screenID],3)
AS FirstThree, tblFeedbackCollection.screenID,
tblFeedbackCollection.dateSubmitted, tblFeedbackCollection.teamMember,
tblFeedbackCollection.status, tblFeedbackCollection.startDate,
tblFeedbackCollection.endDate, tblFeedbackCollection.type,
tblFeedbackCollection.topic, tblFeedbackCollection.feedback,
tblFeedbackCollection.phase, tblFeedbackCollection.idtComments,
tblFeedbackCollection.transientSelect FROM tblFeedbackCollection WHERE
(((Left([screenID],3))='" & strCourseID & "') AND
((tblFeedbackCollection.dateSubmitted) Between #" & datStartDate & "# And #"
& datEndDate & "#) AND ((tblFeedbackCollection.status)='" & strStatus & "')
AND ((tblFeedbackCollection.phase)='" & strPhase & "'));"
'open form to be filtered
DoCmd.OpenForm "frmSecondFilter", acNormal, , , acFormPropertySettings,
acHidden
'assign recordsource
Forms!frmSecondFilter.RecordSource = strSQL
'make sure view is datasheet
'Forms!frmSecondFilter.ViewsAllowed = datasheet
'make form visible
Forms!frmSecondFilter.Visible = True