Populate a variable from a table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table within the database with single entry.
I would like to extract that data and populate it onto a variable declared
in a module but am having trouble referencing the field.
I'm sure that it is straightforward but......

Thanks in advance.
 
If you are saying the table has only one row and you want the value of a
field in a variable in your module, then this will work:

Dim VarSomeVariable as Variant

varSomeVariable = DLookup("[SOME_FIELD]", "SomeTable")
 
Thanks. This works fine.



Klatuu said:
If you are saying the table has only one row and you want the value of a
field in a variable in your module, then this will work:

Dim VarSomeVariable as Variant

varSomeVariable = DLookup("[SOME_FIELD]", "SomeTable")

MH UK said:
I have a table within the database with single entry.
I would like to extract that data and populate it onto a variable declared
in a module but am having trouble referencing the field.
I'm sure that it is straightforward but......

Thanks in advance.
 
AWESOME :)))))) Glad I found this post :)
Worked for me too :)
Thank you all !!! :)

MH UK said:
Thanks. This works fine.



Klatuu said:
If you are saying the table has only one row and you want the value of a
field in a variable in your module, then this will work:

Dim VarSomeVariable as Variant

varSomeVariable = DLookup("[SOME_FIELD]", "SomeTable")

MH UK said:
I have a table within the database with single entry.
I would like to extract that data and populate it onto a variable declared
in a module but am having trouble referencing the field.
I'm sure that it is straightforward but......

Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top