Setting Variables

  • Thread starter Thread starter David Hunt
  • Start date Start date
D

David Hunt

I am trying to set variables to a specific value found in
a table based on it's primary key.

********* begin code sample ***********

dim precut_tabs_cost as Variant

precut_tabs_cost = [charges].[unit_price] ' where [id=26]

********* end code sample ***********

I'm not getting the syntax right. Any help would be
greatly appreciated.
 
David Hunt said:
I am trying to set variables to a specific value found in
a table based on it's primary key.

********* begin code sample ***********

dim precut_tabs_cost as Variant

precut_tabs_cost = [charges].[unit_price] ' where [id=26]

********* end code sample ***********

There is no syntax for directly accessing a particular Field/Row in a table
like this. You need to use a DLookup function or create a Recordset.

precut_tabs_cost = DLookup("unit_price", "charges", "id=26")
 
Back
Top