Gasman
Enthusiastic Amateur
- Local time
- Today, 06:03
- Joined
- Sep 21, 2011
- Messages
- 14,317
JHB provided you with a solution.
The control for Lab A LCD is populated by this code
however once set it is not cleared, that is why you see 3, that is left over from a previous search.
So set each control to 0 before issuing the sql for the recordset.
Use the same logic for the other controls.
The control for Lab A LCD is populated by this code
Code:
Set rst = dbs.OpenRecordset("SELECT SchoolName, Lab, device, Kind " _
& "FROM SchoolNameTbl INNER JOIN DevicesTbl ON SchoolNameTbl.ID = DevicesTbl.ID " _
& "WHERE [SchoolName]like '*" & Me.Text0.Text & "*' " _
& "AND Lab='Lab-A' AND Device='LCD'")
If Not rst.EOF Then
rst.MoveLast
Me.FrmHlp.Form!CountLCDLabA = rst.RecordCount
End If
however once set it is not cleared, that is why you see 3, that is left over from a previous search.
So set each control to 0 before issuing the sql for the recordset.
Code:
[B]Me.FrmHlp.Form!CountLCDLabA = 0[/B]
Set rst = dbs.OpenRecordset("SELECT SchoolName, Lab, device, Kind " _
& "FROM SchoolNameTbl INNER JOIN DevicesTbl ON SchoolNameTbl.ID = DevicesTbl.ID " _
& "WHERE [SchoolName]like '*" & Me.Text0.Text & "*' " _
& "AND Lab='Lab-A' AND Device='LCD'")
If Not rst.EOF Then
rst.MoveLast
Me.FrmHlp.Form!CountLCDLabA = rst.RecordCount
End If
Last edited: