I have a Flexgrid but it always shows 1 less record. If i have 6 records for one Agent, it shows 1 record with no name, and then it shows 5 records with the correct name.
Am i making sense?
Here is my code
Private Sub Combo5_Change()
Dim db As Database
Dim rs As Recordset
Dim strFile As String
Dim strSQL As String
strFile = "a:\tracker"
strSQL = "SELECT * FROM tracker WHERE aname = '" & Combo5.Text & "'"
Set db = OpenDatabase(strFile)
Set rs = db.OpenRecordset(strSQL)
Call DisplayRSGrid(rs, MSFlexGrid1)
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
If MSFlexGrid1.Rows - 1 = 1 Then
MsgBox MSFlexGrid1.Rows - 1 & " record.", vbInformation, Me.Caption
Else
MsgBox MSFlexGrid1.Rows - 1 & " records.", vbInformation, Me.Caption
End If
End Sub
Am i making sense?
Here is my code
Private Sub Combo5_Change()
Dim db As Database
Dim rs As Recordset
Dim strFile As String
Dim strSQL As String
strFile = "a:\tracker"
strSQL = "SELECT * FROM tracker WHERE aname = '" & Combo5.Text & "'"
Set db = OpenDatabase(strFile)
Set rs = db.OpenRecordset(strSQL)
Call DisplayRSGrid(rs, MSFlexGrid1)
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
If MSFlexGrid1.Rows - 1 = 1 Then
MsgBox MSFlexGrid1.Rows - 1 & " record.", vbInformation, Me.Caption
Else
MsgBox MSFlexGrid1.Rows - 1 & " records.", vbInformation, Me.Caption
End If
End Sub