VB Query shown in Sub Report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all,

I prefer to run my queries in vb code. Is there a way to get the results to
show in a Sub Report?

vSql = "select area_id as POD, logon_id as UserId, count (trans_stt) as Puts
from wcs_to_via_t
where trans_stt ='00'
group by area_id, logon_id

Results:

POD USERID PUTS
---------- -------------------- ----------------
01 AFERNAN 1026
02 CDILWO 977

I know I can base a subreport on a query that would get these results, but
there is more to the sql "Where" statment and it is easier to work with these
varibles in vb.
 
Hi Mark,

Not sure where you're having a problem. AFAICS, you've already got the SQL.
You now only need to assign it as the recordsource for your subreport within
the OnClick procedure of your command button to open your report

Reports!MyReport.RecordSource = vSql

Or am I missing something?

Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top