Hello!
I cant effectively get a counter to work with my code. I'm using the following to scale my form based on the number of records the query returns. At the moment this will scale the form to include the header/footer and one record. I need to multiply the RHeight by the number of records then this will be fine.
Code:
Private Sub Form_Open(Cancel As Integer)
Dim RHeight As Integer
Dim intHeightHeader As Integer
Dim intHeightFooter As Integer
intHeightHeader = Forms!Needs_cost_Info_F.Section(acHeader).Height
intHeightFooter = Forms!Needs_cost_Info_F.Section(acFooter).Height
RHeight = Forms!Needs_cost_Info_F.Section(acDetail).Height
intTotalFormHeight = intHeightHeader + intHeightFooter + RHeight
With Me
.InsideHeight = intTotalFormHeight
End With
End Sub
Querys used:
Needs_cost_Info_Q - This returns the records for the form.
Needs_cost_Info_Counter - this is just a counter It displays a single number.
I've tried with no success using DAO record count and ADODB.recordset. Im sure using these is pretty simple with some understanding but I cant get it to work at all. (I'm referencing ADODB.recordset on the DB I believe)
another option that could work is referencing a query that I have that simply counts the results from the initial query. But I don't know how to reference this or... If I could somehow have this hidden on the form without being part of the record source for the detail section of the form.
any feedback and ideas appreciated. Thanks
Andy.,