G
Guest
I want to run the following to change the recordsource of a subreport. The
parameters of firstqtr will change (in reality it is not hard coded).
How many things am I missing?
Also ,where do I put this? I thought it was in the report open, but ran
into problems.
code begin******************
private sub report_open()
Dim ssql1 As String
dim firstqtr as string
firstqtr = "20051"
ssql1 = "SELECT tblEVENT_LOG.txtAUDIT_ENTITY,
rtblACTION_TABLE.txtACTION," & _
"tblEVENT_LOG.memNOTES, tblEVENT_LOG.intRISK_SCORE " & _
"FROM tblEVENT_LOG " & _
"INNER JOIN rtblACTION_TABLE " & _
"ON tblEVENT_LOG.intACTION_NO = rtblACTION_TABLE.intACTION_NO "
& _
"WHERE ((([tblEVENT_LOG]![txtIMPACT_YEAR] & " & _
"[tblEVENT_LOG]![txtIMPACT_QTR])=" & "'" & firstqtr & "'" & "))"
MsgBox ssql1
Me!srptdetail_qtr_plus1.report.recordsource = ssql1
code end **********************************
parameters of firstqtr will change (in reality it is not hard coded).
How many things am I missing?
Also ,where do I put this? I thought it was in the report open, but ran
into problems.
code begin******************
private sub report_open()
Dim ssql1 As String
dim firstqtr as string
firstqtr = "20051"
ssql1 = "SELECT tblEVENT_LOG.txtAUDIT_ENTITY,
rtblACTION_TABLE.txtACTION," & _
"tblEVENT_LOG.memNOTES, tblEVENT_LOG.intRISK_SCORE " & _
"FROM tblEVENT_LOG " & _
"INNER JOIN rtblACTION_TABLE " & _
"ON tblEVENT_LOG.intACTION_NO = rtblACTION_TABLE.intACTION_NO "
& _
"WHERE ((([tblEVENT_LOG]![txtIMPACT_YEAR] & " & _
"[tblEVENT_LOG]![txtIMPACT_QTR])=" & "'" & firstqtr & "'" & "))"
MsgBox ssql1
Me!srptdetail_qtr_plus1.report.recordsource = ssql1
code end **********************************