PC Review


Reply
Thread Tools Rate Thread

data into vba

 
 
Dazzadata
Guest
Posts: n/a
 
      9th Jul 2008
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
 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      9th Jul 2008
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



 
Reply With Quote
 
Paolo
Guest
Posts: n/a
 
      9th Jul 2008
Hi Dazzadata,
if in your table you have just the row with the path you can use a dlookup
without criteria. e.g. (in the sample I name the field with the path yourpath
and the table containing it yourtable. you'll have to substitute those names
with the correct one)

the_path=dlookup("yourpath","yourtable")

HTH Paolo

"Dazzadata" wrote:

> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Save 60% on Data Entry, Data Conversion, Data Processing Services byOffshore-Data-Entry dataentryoffshore@gmail.com Microsoft Excel Programming 0 4th Jun 2008 05:02 PM
Save 60% on Data Entry, Data Conversion, Data Processing Services byOffshore-Data-Entry dataentryoffshore@gmail.com Microsoft Excel Programming 0 4th Jun 2008 05:00 PM
Professional Data Conversion,Data Formats and Affordable Data EntryServices by Data Entry India Data Entry India Microsoft Access Form Coding 0 31st Mar 2008 12:50 PM
Data Entry Online, Data Format, Data Conversion and Data EntryServices through Data Entry Outsourcing admin.dataentryoutsourcing@gmail.com Microsoft Excel Misc 0 20th Mar 2008 01:45 PM
Data Entry Online, Data Format, Data Conversion and Data EntryServices through Data Entry Outsourcing admin.dataentryoutsourcing@gmail.com Microsoft Access Form Coding 0 20th Mar 2008 01:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:47 PM.