Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Heavy Duty Unbound Reports

Status
Not open for further replies.

pcdaveh

Technical User
Sep 26, 2000
213
US
I need some examples of Heavy duty Unbound reports. I'm looking for anyone that has a sample database that contains Heavy duty Unbound reports. I need examples so I can complete my task. Currently I have a bound report to a query. Structured like this

Header

Investor name

Partnership Name

Detail1 Detail2 Detail3 Detail4 DetailN...
Next Detail line

Totals

Right here I need to insert a line of data that will not appear in the detail lines above. It's like a second detail section. I'll also need to create a total of these lines and add them to the totals after the first detail section. I don't believe a sub report will handle that unless I can get the totals from the first detail section into the subreport. Any suggestions?

 
WELL UNFORTUNATLY I CAN'T GIVE A SAMPLE OF ON UNBOUND REPORT, I AM CURRENTLY TRYING TO DO THE SAME THING. WHAT I CAN DO IS POINT YOU IN GOOD DIRECTION. TRY THERE IS MICROSOFT ACCESS 2000:BUILDING APPLICATIONS WITH THE FORMS AND REPORTS. DOWNLOAD THE ORDERS AND DEVELOPERS SOLUTIONS SAMPLE APPLICATION. IT WILL WALK YOU THROUGH AND GIVE YOU THE CODE FOR CREATING A CROSSTAB REPORT WITH DYNAMIC COLUMN HEADINGS. WHICH IS JUST READING A QUERY OR A TABLE AND PASTING THAT IN UNBOUND FIELD ON A REPORT, WITH A TOTALS ROW. I PERSONALLY CAN'T GET MINE TO WORK BUT MAYBE YOU WILL BE MORE SUCCESSFUL.
 
also try this, i finally got mine to work.

Private Sub Report_Open(Cancel As Integer)
' You didn't know how many columns, or what
' their names would be, until now.
' Fill in the label captions,
' and control ControlSources.

Dim intColCount As Integer
Dim intControlCount As Integer
Dim I As Integer
Dim strName As String, strSQL As String

Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset

On Error Resume Next

Set cnn = CurrentProject.Connection
Set rst = New ADODB.Recordset

strSQL = "Select * from [" & Me.RecordSource & "]"

rst.Open Source:=strSQL, ActiveConnection:=cnn, LockType:=adLockReadOnly

intColCount = rst.Fields.Count
intControlCount = Me.Detail.Controls.Count


If intControlCount < intColCount Then
intColCount = intControlCount
End If


' Fill in information for the necessary controls.
For I = 1 To intColCount
strName = rst.Fields(I - 1).NAME
Me.Controls(&quot;lblHeader&quot; & I).Caption = strName
Me.Controls(&quot;txtData&quot; & I).ControlSource = strName

Next I

' Hide the extra controls.
For I = intColCount + 1 To intControlCount
Me.Controls(&quot;txtData&quot; & I).Visible = False
Me.Controls(&quot;lblHeader&quot; & I).Visible = False
Me.Controls(&quot;txtSum&quot; & I).Visible = False
Next I

' Close the recordset.
rst.Close
cnn.Close

Set rst = Nothing
Set cnn = Nothing
End Sub
SHAWNDRA CREE JONES,
DATABASE DEVELOPER
TOYOTA MOTOR MANUFACTURING NORTH AMERICA
ERLANGER, KY
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top