rtdc
Registered User.
- Local time
- Today, 11:32
- Joined
- Feb 27, 2007
- Messages
- 55
I need to make the field name created in the ‘as’ statement in this sql a variable I can call in RS.???
What I have so far: -
Srch = Me.Select_field & " as " & F1
When run this reads “[Car List]![Make] as Make” which is correct
Set RS = CurrentDb.OpenRecordset("SELECT " & Srch & " FROM [Car List] WHERE ((([Car List]![ID])= 79 ))")
Returns the value “Nissan” which is correct
RS.MoveFirst
Me.Text11 = RS.Make
What I need to do is something like RS.F1 instead of RS.Make so I can access the RS result using the variable F1 not use the same field name every time, in this example it is “Make” but next time it could be “Model”.
Is this possible?
Cheers
:banghead:
What I have so far: -
Srch = Me.Select_field & " as " & F1
When run this reads “[Car List]![Make] as Make” which is correct
Set RS = CurrentDb.OpenRecordset("SELECT " & Srch & " FROM [Car List] WHERE ((([Car List]![ID])= 79 ))")
Returns the value “Nissan” which is correct
RS.MoveFirst
Me.Text11 = RS.Make
What I need to do is something like RS.F1 instead of RS.Make so I can access the RS result using the variable F1 not use the same field name every time, in this example it is “Make” but next time it could be “Model”.
Is this possible?
Cheers
:banghead: