Sad Der
accessd666 at yahoo.com
Thu Oct 9 04:40:34 CDT 2003
Sorry...the visible prop was NO!!
SD
PS: 14.400 records with 26 fields (12 was a test) in 2
seconds. Formatted, Moved and Coloured!!
--- Sad Der <accessd666 at yahoo.com> wrote:
> Hi group,
> I created a report. Recordsource is a query.
> The report has a report header and a report detail.
> In the report header I have 12 labels named:
> lblHeaderx (x = a number between 1 through 12)
>
> In the report detail section I have 12 textboxes
> named:
> txtDatax (x = a number between 1 through 12)
>
> In the forms On_Open event I've got the code below
> (from ADHB2K). However I cannot seem to get any
> data?!?! Any idea why not?
>
> TIA
>
> SD
>
> 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
>
> On Error Resume Next
>
> Dim rst As ADODB.Recordset
>
> Set rst = New ADODB.Recordset
> rst.Open _
> Source:=Me.RecordSource, _
> ActiveConnection:=CurrentProject.Connection, _
> Options:=adCmdTable
>
> 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("lblHeader" & i).Caption =
> strName
> Me.Controls("txtData" & i).ControlSource =
> strName
> Next i
>
> ' Hide the extra controls.
> For i = intColCount + 1 To intControlCount
> Me.Controls("txtData" & i).Visible = False
> Me.Controls("lblHeader" & i).Visible = False
> Next i
>
> ' Close the recordset.
> rst.Close
> End Sub
>
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product
> search
> http://shopping.yahoo.com
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com