dbTalk Databases Forums  

How to use VBA to step through a table?

comp.database.ms-access comp.database.ms-access


Discuss How to use VBA to step through a table? in the comp.database.ms-access forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
JF Main
 
Posts: n/a

Default How to use VBA to step through a table? - 06-29-2008 , 01:11 PM






I am an old FoxPro programmer having trouble transitioning to Access,
and I have a hot project to work on.

I have a record for a company. That record has a field of account
numbers. The account number field can have from 1 to 16 account
numbers in it, separatd by a ; or semicolon. (Shades of PICK).

How do I convert this type of record

ABC Co, Main Street, Anywhere, PA, 1234;1237;1239;1290

to this

ABC Co, Main Street, Anywhere, PA, 1234
ABC Co, Main Street, Anywhere, PA, 1237
ABC Co, Main Street, Anywhere, PA, 1239
ABC Co, Main Street, Anywhere, PA, 1290

How do I do it in Access?

Mainly I can't find references to do what I thought were common
database functions, such as

1. stepping through a table's recrods and

2. adding a record to a second table based on some sort of processing
logic.

Here is a simpilified version of what I would do if I were to do it in
Foxpro

use Table1

use Table2

select Table1 - change to Table1
do while not EOF() - end of file

test for necessary condition to add more records
do procedure add a record & loop through if necessayr

skip to next record

enddo

procedure add a record to a second table

do processing

end procedure

Any help would be appreciated

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.