Forum Discussion
Maxine14062
Oct 15, 2024Brass Contributor
FindFirst not working
I have a 365 database with the following code: Set rst = CurrentDb().OpenRecordset("SchedFieldTable") mFID = DLookup("[FID]", "SchedFieldTable", "[Width]+[Left] > 10.5 * 1440") MsgBox "[FID] = "...
GustavBrock
Oct 16, 2024MVP
You can filter the recordset directly:
Dim rst As DAO.Recordset
Dim SQL As String
SQL = "Select * From SchedFieldTable Where [Width] + [Left] > 10.5 * 1440"
Set rst = CurrentDb.OpenRecordset(SQL)
If rst.RecordCount > 0 Then
' List the found FIDs.
rst.MoveFirst
While Not rst.EOF
Debug.Print rst!FID.Value, rst!Width.Value, rst!Left.Value
rst.MoveNext
Wend
End If
rst.Close
Maxine14062
Oct 16, 2024Brass Contributor
Thanks all of you. But I got it to work by myself.