ReportControl Frustration |
Post Reply |
Author | |
Nicolaus
Newbie Joined: 28 June 2007 Location: Germany Status: Offline Points: 4 |
Post Options
Thanks(0)
Posted: 11 July 2007 at 9:14am |
I'm completely frustrated after hours of experimenting with
the ReportControl. I'm using "Access XP" and I tried to build an absolute simple app with one ReportContrl and a few test records. Dim Column As ReportColumn Dim Record As ReportRecord Dim Item As ReportRecordItem Set Column = wndReportControl.Columns.Add(101, "Column 1", 100, False) Column.AllowDrag = False Set Record = wndReportControl.Records.Add Set Item = Record.AddItem("First Item") wndReportControl.Populate However, the ReportControl is always empty showing only an empty record line. Any ideas? Cheers Nick |
|
nvierros
Groupie Joined: 02 July 2006 Location: Australia Status: Offline Points: 44 |
Post Options
Thanks(0)
|
Hey Nick,
This code seems to work on for me.
Dim Column As ReportColumn
Dim record As ReportRecord Set Column = ReportControl.Columns.Add(0, "Customer ID", 80, True)
Column.AllowDrag = False Set Column = ReportControl.Columns.Add(1, "Name", 80, True)
Column.AllowDrag = False Set record = ReportControl.Records.Add() record.AddItem "C0000001"
record.AddItem "Nick" ReportControl.Populate Cheers
|
|
Nicolaus
Newbie Joined: 28 June 2007 Location: Germany Status: Offline Points: 4 |
Post Options
Thanks(0)
|
Thanks a lot mate!
You really saved my day. It works for me too, although I don't quite understand why my own sample didn't. Cheers Nick |
|
nvierros
Groupie Joined: 02 July 2006 Location: Australia Status: Offline Points: 44 |
Post Options
Thanks(0)
|
Hey Nick, On further analysis of your code, i changed: Set Column = wndReportControl.Columns.Add(101, "Column 1", 100, False)
TO:
Set Column = wndReportControl.Columns.Add(0, "Column 1", 100, False)
and that seemed to fix the problem, not sure why it does this though..
Cheers
Nick
|
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
It is because you put index of column to 101. The first param is an index not an id.
|
|
Nicolaus
Newbie Joined: 28 June 2007 Location: Germany Status: Offline Points: 4 |
Post Options
Thanks(0)
|
Ah.. the light just went on. Got it.
btw. has anyone an idea how to use a groupbox with radiobuttons with Access XP? It doesn't seem to be possible to insert the radio buttons in the groupbox and if I try to use the radio buttons alone then it's not possible for me to enable a radio button more than once. Strange behaviour indeed. Cheers nick |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |