Microsoft
Software
Hardware
Network
Question : Help with recordsets
I have a tab control with several pages and each page contains a subform. I would like to display the recordcount of the subform in the tabcontrol page caption, but I can't seem to figure out how to do it correctly.
I am using this code:
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = currentdb()
Set rst = db.OpenRecordset("T_ITEM_N
BR_LINKS",
dbOpenDynaset)
rst.FindFirst "ITEM_NBR = " & Me.id
If rst.NoMatch Then
Me.TabCtl48.Pages(6).Visib
le = True
Me.TabCtl48.Pages(6).Capti
on = "links (0)"
Else
Me.TabCtl48.Pages(6).Visib
le = True
Me.TabCtl48.Pages(6).Capti
on = "links (" & rst.RecordCount & ")"
End If
rst.Close
But I get a links (965) caption, which is all of the records in the table.
How can I drill down to only those links pertaining to the ITEM_NBR that is on the form field 'me.id' ?
Thanks...
Answer : Help with recordsets
change this
Me.TabCtl48.Pages(6).Capti
on = "links (" & rst.RecordCount & ")"
to
Me.TabCtl48.Pages(6).Capti
on = "links (" & me.[nameofsubform].form.re
cordsetclo
ne.RecordC
ount & ")"
Random Solutions
how to change the date format on the X-axis - ssrs
Column headings in crosstab queries part 2
Promoting secondary dns server to primary
VBA Powerpoint 2003/2007 - Align text inside a textbox/Shape
Hide panel navigation bar on Access 2007
ATL COM compilation error in atlcom.h
How to call a sub in a seperate class file
Deploy a change in registry in a terminal server farm
How do I reduce the memory iexplore.exe is using, as it can get as high as 260,000k
Visual basic: how to use the Mouse wheel on and off (lebans software):