After ths line where you assign the string, add this line:
Debug.Print Sql
When it fails, press Ctrl+G to open the Immediate window.
Look at the string, and see if you can see what's wrong.
You should see something like this:
Delete from [gemaakte offertes] in 'C:\MyPath\MyFile.mdb';
Note that the path and mdb extension are both important.
Access does add the *, though it's technically not correct.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
>I did what you wrote (i added a * although) bud keep getting the message:
>
[quoted text clipped - 31 lines]
>> > RecordSetNaam = "[gemaakte offertes]"
>> > RecordSetNaam = "gemaakte_offertes"
ReMeE - 16 Nov 2006 19:37 GMT
this is what it says:
Delete * from [Gekalkuleerde Werken] IN 'E:\Documenten van
Rene\ReCaLc\Backup\16-11-2006\OffertesBackend.mdb'
what is wrong here?
> After ths line where you assign the string, add this line:
> Debug.Print Sql
[quoted text clipped - 43 lines]
> >> > RecordSetNaam = "[gemaakte offertes]"
> >> > RecordSetNaam = "gemaakte_offertes"
ReMeE - 16 Nov 2006 19:55 GMT
I finaly found the error in the next line which was also in the routine:
Sql = "INSERT INTO [" & RecordsetNaam & "] IN '" & BackendNaam & "' " &
"SELECT * FROM [" & RecordsetNaam & "]"
first it whas like this:
Sql = "INSERT INTO [" & RecordsetNaam & "] IN '" & BackendNaam & "' " &
"SELECT * FROM " & RecordsetNaam
There where no brackets added to the second 'RecordsetNaam'.
Thanks for helping me out allen
> After ths line where you assign the string, add this line:
> Debug.Print Sql
[quoted text clipped - 43 lines]
> >> > RecordSetNaam = "[gemaakte offertes]"
> >> > RecordSetNaam = "gemaakte_offertes"
ReMeE - 16 Nov 2006 20:34 GMT
As I managed to make it work here is my whole routine for other people. Is
ther an other way of Runsql on a password protected database as the way I did?
Sub MaakDeBackup(BackendNaam, RecordsetNaam, PasWoord)
Dim Db As Database, Rs As Recordset, Sql as string
If IsNull(PasWoord) Or PasWoord = "" Then
Set Db = DBEngine.Workspaces(0).OpenDatabase(BackendNaam, False,
False)
Else
Set Db = DBEngine.Workspaces(0).OpenDatabase(BackendNaam, False,
False, ";PWD=" & PasWoord)
End If
Set Rs = Db.OpenRecordset(RecordsetNaam)
'Maak eerst het backupbestand leeg indien deze dat nog niet is
Sql = "Delete from [" & RecordsetNaam & "] IN '" & BackendNaam & "'"
DoCmd.RunSQL Sql
'Vul het backup bestand met de nieuwe data
Sql = "INSERT INTO [" & RecordsetNaam & "] IN '" & BackendNaam & "' " &
"SELECT * FROM [" & RecordsetNaam & "]"
DoCmd.RunSQL Sql
Rs.Close
Db.Close
End Sub
> After ths line where you assign the string, add this line:
> Debug.Print Sql
[quoted text clipped - 43 lines]
> >> > RecordSetNaam = "[gemaakte offertes]"
> >> > RecordSetNaam = "gemaakte_offertes"