A
Anand Vaidya
Douglas, I followed your method of passing values from a form to report and
wrote code something like this-
in cmdGenerateReport_Click event in form frmReports --
Dim strArgs As String
strArgs = dtFromDate & ";" & dtToDate
DoCmd.OpenReport "rptDailyAttendance_Brief2",
acViewPreview, , "Attendance_Date between #" & dtFromDate & "# and #" &
dtToDate & "#", , strArgs
in Report_Open event --
Dim varValues As Variant
Dim dtFromDate As Date
Dim dtToDate As Date
If IsNull(Me.OpenArgs) = False Then
varValues = Split(Me.OpenArgs, ";")
dtFromDate = varValues(0)
dtToDate = varValues(1)
Me.txtFromDate = dtFromDate ''' getting error here
Me.txtToDate = dtToDate
End If
txtFromDate and txtToDate are unbound fields in the report
I am getting an error at Me.txtFromDate=....The error says -" You can't
assign a value to this object."
I am able to retrieve the values of the FromDate and ToDate from the form
frmReports into the report_open event but I am unable to assing these values
to the txtFromDate and txtToDate text fields of the report.How do I do this?
wrote code something like this-
in cmdGenerateReport_Click event in form frmReports --
Dim strArgs As String
strArgs = dtFromDate & ";" & dtToDate
DoCmd.OpenReport "rptDailyAttendance_Brief2",
acViewPreview, , "Attendance_Date between #" & dtFromDate & "# and #" &
dtToDate & "#", , strArgs
in Report_Open event --
Dim varValues As Variant
Dim dtFromDate As Date
Dim dtToDate As Date
If IsNull(Me.OpenArgs) = False Then
varValues = Split(Me.OpenArgs, ";")
dtFromDate = varValues(0)
dtToDate = varValues(1)
Me.txtFromDate = dtFromDate ''' getting error here
Me.txtToDate = dtToDate
End If
txtFromDate and txtToDate are unbound fields in the report
I am getting an error at Me.txtFromDate=....The error says -" You can't
assign a value to this object."
I am able to retrieve the values of the FromDate and ToDate from the form
frmReports into the report_open event but I am unable to assing these values
to the txtFromDate and txtToDate text fields of the report.How do I do this?