Danke stefan or thx stefan
can u help me with these:
Public Function ImportAsbisxxx()
Dim db As Database
Dim rs As Recordset
Dim kom As Integer
Dim sqlupit As String
Dim imetabele As Variant
Set db = CurrentDb()
kom = 2
sqlupit = "SELECT Sheetovi.F1 as ime_sheeta FROM Sheetovi WHERE
Sheetovi.AutoBroj=" & kom
Set rs = db.OpenRecordset(sqlupit)
imetabele = rs!ime_sheeta & "!A6:I250"
DoCmd.TransferSpreadsheet acImport, , _
"Asbis_novo", "Z:\Realis\Cjenici\Asbis\asbis.xls", False, imetabele
End Function
and it doesnt work.
if i change :
DoCmd.TransferSpreadsheet acImport, , _
"Asbis_novo", "Z:\Realis\Cjenici\Asbis\asbis.xls", False, imetabele
to
DoCmd.TransferSpreadsheet acImport, , _
"Asbis_novo", "Z:\Realis\Cjenici\Asbis\asbis.xls", False,
"sheetname!A6:I250"
then it works.
i also looked if the sql gives me the right name and it is all ok
is the problem in data type of imetabele
thx
rene
Stefan Hoffmann said:
hi Rene,
I want to delete files from a list that i have in ms access database
i have a list of files that have to bo deleted,all files are in same
folder.
Dim rs As ADO.Recordset
Set rs = New ADODB.Recordset
rs.Open "SELECT Filename, IsDeleted FROM Files WHERE NOT IsDeleted", _
CurrentProject.Connection, _
adOpenDynamic, adLockOptimistic
Do While Not rs.Eof
Kill Path & rs![Filename]
rs![IsDeleted] = True
rs.Update
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
mfG
--> stefan <--