FindFirst - What am I doing wrong? (1 Viewer)

AndyWilcock

New member
Local time
Today, 10:29
Joined
Nov 19, 2020
Messages
11
Set rstGroups = dbs.OpenRecordset(Name:="Group_T", Type:=RecordsetTypeEnum.dbOpenDynaset)

MsgBox Me.Group ' This shows 340 on the screen which is the group i want from rstGroups
rstGroups.FindFirst "GrpID = Me.Group" ' But this line finds the first group in the rstGroups table - grrrrr

so why......

MsgBox Me.Group ' This shows 340 on the screen which is the right Record i want from rstGroups
rstGroups.FindFirst "GrpID = 340" ' finds the correct Record

What am I doing wrong?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:29
Joined
Oct 29, 2018
Messages
21,471
Hi. Welcome to AWF!

Try:
Code:
rstGroups.FindFirst "GrpID=" & Me.Group
Hope that helps...
 

Gasman

Enthusiastic Amateur
Local time
Today, 10:29
Joined
Sep 21, 2011
Messages
14,287
Code:
"GrpID = " & Me.Group
 

Users who are viewing this thread

Top Bottom