loop

  • Thread starter Thread starter Frank Dulk
  • Start date Start date
F

Frank Dulk

in that code it goes by the loop and it already goes direct for msgbox as
if had made the backup but in a did


Dim x As Variant, z As String
Dim y As Integer, w As Integer
z = "back"
x = Array("tst", "tst1", "tst2", "tst3", "tst4")
For y = 1 To y = 5 Step 1
w = y
DoCmd.OpenTable (x(w))
Application.ExportXML acExportTable, x(w), "c:\" & (x(y) & z) & ".xml"
DoCmd.Close acTable, x(w), acSaveNo
Next
MsgBox " finished backup", vbOKOnly


For who to help a thank you very much already early
 
Try

For y = 1 to 5 step 1 ...

You may also want to try using more than single letter
variable names and prefixing them with their data types
(eg varFiles) to improved readability.

It doesn't look like you need w.

Good Luck.
Jeremy
 
Back
Top