By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,375 Members | 1,116 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,375 IT Pros & Developers. It's quick & easy.

Selecting one field in an Access table

P: 41
Hey all, I have a table in Access with 13 rows and 2 columns. The first column has numbers 1 to 13 in ascending order, and the second column has three-letter codes that correspond to each number, like so:

ID_number Code

In VB, I have a loop that generates a bunch of Excel files, so my loop goes for i = 1 to 13. I would like to be able to name the worksheet in the workbook I created with the corresponding three-letter code.

For example, if i = 1, the worksheet's name should be ARS, for i = 2 the worksheet should be CAD etc. Could someone please help since I am not sure how to refer to the code in column 2 if I know which row it should be located in (based on i)? Thanks in advance....
Oct 29 '07 #1
Share this Question
Share on Google+
5 Replies

Expert 2.5K+
P: 2,653
What about DLookUp function?
Oct 29 '07 #2

P: 41
Thanks for replying, FishVal. I got around it by looping through the elements in the table instead (do until XXX.EOF etc) so it seems to work, but in a roundabout way.
Oct 30 '07 #3

Expert Mod 15k+
P: 31,561
How do you generate the Excel files?
Nov 1 '07 #4

P: 41
I open an Excel application and just paste the data that I generated from the Access SQL Query...
Nov 1 '07 #5

Expert Mod 15k+
P: 31,561
It's a bit labour intensive, but if you're happy with it...
Nov 2 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.