I am trying to get my program to select records from a table using a field on a form as criteria, so that I can perform calculations on that data and return a value to another field on the form. I keep getting (Run-Time error 2465 Microsoft Access can't find the field '|' referred to in your expression)
the code is:
Dim sSQL As String
Set MyDb = CurrentDb
Dim TempGroup As String
location.SetFocus
TempGroup = Me.location.Text
sSQL = "Parameters TempGroup String; Select Location, MEASUREMENT from Table1 Where Location = tempgroup ORDER BY MEASUREMENT"
Set MyRS = MyDb.OpenRecordset([sSQL], [adReadOnly])
What am I doing Wrong?
the code is:
Dim sSQL As String
Set MyDb = CurrentDb
Dim TempGroup As String
location.SetFocus
TempGroup = Me.location.Text
sSQL = "Parameters TempGroup String; Select Location, MEASUREMENT from Table1 Where Location = tempgroup ORDER BY MEASUREMENT"
Set MyRS = MyDb.OpenRecordset([sSQL], [adReadOnly])
What am I doing Wrong?