N
Nigel
I am trying to use code to reattach some tables
this is what I have so far, all I need is some assistance and I can figure
the rest out
The 4 tables are defined
I am using the loop function increase a count by 1 (works) and then add it
to a variable called deltable (this is the wrong kind of loop)
really what should happen is it should scroll thru the variables called
TableA* and delete them and keep going till all the tables are all deleted
Any help would be appreciated
Dim TableA1, TableA2, TableA3, TableA4 As String
TableA1 = "address"
TableA2 = "addsubform"
TableA3 = "buyers"
TableA4 = "catsales"
DoCmd.SetWarnings False
DoCmd.Hourglass True
' Step 1 removes all existing links
DoCmd.Hourglass True
Dim counter
Dim deltable as string
counter = 0
Do While counter <= 4
MsgBox counter
counter = counter + 1
deltable = "tableA" & counter
DoCmd.DeleteObject acTable, deltable
Loop
this is what I have so far, all I need is some assistance and I can figure
the rest out
The 4 tables are defined
I am using the loop function increase a count by 1 (works) and then add it
to a variable called deltable (this is the wrong kind of loop)
really what should happen is it should scroll thru the variables called
TableA* and delete them and keep going till all the tables are all deleted
Any help would be appreciated
Dim TableA1, TableA2, TableA3, TableA4 As String
TableA1 = "address"
TableA2 = "addsubform"
TableA3 = "buyers"
TableA4 = "catsales"
DoCmd.SetWarnings False
DoCmd.Hourglass True
' Step 1 removes all existing links
DoCmd.Hourglass True
Dim counter
Dim deltable as string
counter = 0
Do While counter <= 4
MsgBox counter
counter = counter + 1
deltable = "tableA" & counter
DoCmd.DeleteObject acTable, deltable
Loop