Simplest way would be to use DLookup:
Dim strFilePath
strFilePath = DLookup("[NameOfField]", "[NameOfTable]")
That assumes that the table only has one row in it. If there's more, you can
specify a Where clause as the third argument:
strFilePath = DLookup("[NameOfField]", "[NameOfTable]",
"[SomeField]='SomeValue'")
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Dazzadata" <(E-Mail Removed)> wrote in message
news:4EBE4C79-4254-4DC0-88F1-(E-Mail Removed)...
> simplest question ever but how do you get a value from a table into vba.
>
> I want to put a path into a table as a constant, get vba to pick this up
> and
> use the transferspreadsheet cmd to load a series of data rows into a table
>
> works like a charm but at the minute the path is put in using an inputbox
>
> cheers