loop

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
 
J

Jeremy Hughes

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top