sp on record source property (adp report)

A

Ashfaq Parkar

hi guyes

1) i m using sql2k as back end and front end access xp (adp)

2) i have one form with 2 controls :

1) Account Number, controls name = cbAcct
2) Sub Code, controls name = cbSubCode

3) i have developed one report

** Recordsouce property is set to sp (parameters: Company or null, Acct or
null SubCode or null)

4) i have set inputparamter property of report to :

@CompanyNumber char = '05', @Account char =
Forms!frm_Print_By_Acct_By_SubCode!cbAcct, @SubCode char =
Forms!frm_Print_By_Acct_By_SubCode!cbSubCode

5) forms cbAcct click event

DoCmd.OpenReport "Receivable_1211", acViewPreview

works very fine for the first time.

i want to have :

when cbSubCode Click

report should show only selected account(cbAcct value) and subcode
(cbSubCode value) in preview mode.

I tried the following:

Set pStrCompany = cmd.CreateParameter("strCO", adChar,
adParamInput, 2)

cmd.Parameters.Append pStrCompany

Set pStrAccount = cmd.CreateParameter("strAcct", adChar,
adParamInput, 4)

cmd.Parameters.Append pStrAccount

Set pStrSubCode = cmd.CreateParameter("strSubCode", adChar, adParamInput, 5)

cmd.Parameters.Append pStrSubCode
strSQL = "{call dbo.Receivable_Aging_InDays (?,?,?)}"

cmd.CommandText = strSQL
cmd.Execute

but does not show selected account and subcode, it shows the last one open
with cbAcct click event.

i there any way other than close report and reopen again with new parameter
? can somebody help me on this? really is it possible? as when u open report
in preview mode u cannot change recordsource or inputput parameter property.

i tried with recordset object also :

set report.recordsource = rs in report open event, but only first time,
second time it stucks or not giving.

thanks and kind regards

Ashfaq Parkar
 
Top