Two Column Report

D

DS

I have a Two Column Report, I'm setting the recordsource from the on open
event. Such as..
Me.RecordSource = "Select SELECT tblPayIns.PayInBizDay,
tblSalesCats.SalesCatName, tblReportCats.ReportCatName,
tblPayIns.PayInAmount AS DOLL
FROM ((tblSalesCats INNER JOIN tblRptSetUp ON tblSalesCats.SalesCatID =
tblRptSetUp.SalesCatID) INNER JOIN tblPayIns ON tblRptSetUp.ReportCatID =
tblPayIns.PayInRedID) INNER JOIN tblReportCats ON tblPayIns.PayInRedID =
tblReportCats.ReportCatID " & _
"UNION " & _
"SELECT tblPayApplied.PayAppliedBizDay, tblPayTypes.PayTypeName,
tblPayName.PayName, Sum(tblPayApplied.PayAppliedAmount) AS
SumOfPayAppliedAmount
FROM (tblPayApplied INNER JOIN tblPayName ON
tblPayApplied.PayAppliedNameID=tblPayName.PayNameID) INNER JOIN tblPayTypes
ON tblPayName.PayNameTypeID=tblPayTypes.PayTypeID
GROUP BY tblPayApplied.PayAppliedBizDay, tblPayTypes.PayTypeName,
tblPayName.PayName;"

I want the fields from the first query to be in Column A and the the fields
from the second query to be in Column B. Can this be done? If so, how.
Thanks
DS
 
D

DS

So I decided to try this but I'm not getting a reference to the two columns
on the report.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.Columns(0) = DLookup("TestType", "tblTester", "TestType=1")
Me.Columns(1) = DLookup("TestType", "tblTester", "TestType=2")
End Sub

There should be a way to select criteria for each column, No?
Thanks
DS
 
R

Rick Brandt

DS said:
So I decided to try this but I'm not getting a reference to the two
columns on the report.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.Columns(0) = DLookup("TestType", "tblTester", "TestType=1")
Me.Columns(1) = DLookup("TestType", "tblTester", "TestType=2")
End Sub

There should be a way to select criteria for each column, No?

No. You actually have one continuous column that "snakes" on the page. The
item at the top of column 2 is merely the first record that didn't fit in
column 1.

Two sub-reports is the only method that comes to mind.
 
D

DS

So Rick, I almost have this working. Under Grouping and Sorting I merely
listed the GROUP twice...This sorts it out as needed.
Thnaks
DS
 

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

Similar Threads

Crosstab Query Fields 2
Field >0 2
RunTime Error 438 4
Report combiones all records 3
Crosstab Report's subreport 1
report help needed thanks 1
OPEN ARGS Trouble 2
Report by date range 6

Top