W
wdsnews
I'm helping a school turn an Access 2000 Jet flat file database into a
relational database and this is my opportunity to get introduced to Access
VBA coding. In this example, I want to move phone numbers to a child table
and I hope to find an example code listing of the types of commands and
their use in Access. Two things would help me tremendously; a suggestion on
how to use the MS Access Help system, and a link to a sample listing that
demonstrates the use of basic open and record navigation.
I'm familiar with Paradox and I can use the ObjectPal 'Help' system to find
the 'Open' command and see some code listing choices that usually include a
loop, record or field addressing, and a 'Close'. But the MS Access Help
system seems much more limited.
In ObjectPal I would normally open a TCursor and Scan through the parent
table one record at a time. There's no need to open a visible table during
this one-time operation. Inside my 'Scan' loop I'd create a new record in
the child table for each phone number in the parent table.
;move Home phone number
if not parent.homephone.isblank() then
child.newrecord()
child.ID = child.ID.maxRec() + 1
child.parentID = parent.ID
child.phonetype = "Home"
child phoneNo = parent.homephone
endif
;move Work phone number
....etc...
Thank you for your help. I've already bought two books, but the code
examples all seem focused on opening visible tables. So, if you can provide
this little bit of help, I think I can run with it. Thank you.
relational database and this is my opportunity to get introduced to Access
VBA coding. In this example, I want to move phone numbers to a child table
and I hope to find an example code listing of the types of commands and
their use in Access. Two things would help me tremendously; a suggestion on
how to use the MS Access Help system, and a link to a sample listing that
demonstrates the use of basic open and record navigation.
I'm familiar with Paradox and I can use the ObjectPal 'Help' system to find
the 'Open' command and see some code listing choices that usually include a
loop, record or field addressing, and a 'Close'. But the MS Access Help
system seems much more limited.
In ObjectPal I would normally open a TCursor and Scan through the parent
table one record at a time. There's no need to open a visible table during
this one-time operation. Inside my 'Scan' loop I'd create a new record in
the child table for each phone number in the parent table.
;move Home phone number
if not parent.homephone.isblank() then
child.newrecord()
child.ID = child.ID.maxRec() + 1
child.parentID = parent.ID
child.phonetype = "Home"
child phoneNo = parent.homephone
endif
;move Work phone number
....etc...
Thank you for your help. I've already bought two books, but the code
examples all seem focused on opening visible tables. So, if you can provide
this little bit of help, I think I can run with it. Thank you.