Select. access table rows into Module code variables

  • Thread starter Thread starter Vince
  • Start date Start date
V

Vince

I'm crawling here rather than walking. I want to use a
visual basic module in MS Access to select a database
record into variables I define. I must be missing
something because judging by the errors I'm getting, it's
not recognizing the SQL statement I'm building.

Can anyone tell me what database variables I need to
declare? I used DoCmd.RunSQL {sqlstring}.

Thank you in advance.

Vince.
 
DoCmd.RunSQL does not return values that you can put into variables.

If you only have a few, you can start with DLookUp.

If you have more, you can bind the SQL to a form, and refer
to the form variables.

If that won't work, you can use a DAO or ADO recordset to
hold the values that you can copy into variables

(david)
 
Thanks, David, I'll give that a try.

Vince.
-----Original Message-----
DoCmd.RunSQL does not return values that you can put into variables.

If you only have a few, you can start with DLookUp.

If you have more, you can bind the SQL to a form, and refer
to the form variables.

If that won't work, you can use a DAO or ADO recordset to
hold the values that you can copy into variables

(david)





.
 
Back
Top