I have been working on this module for a while now.
I have made progress with help on a previous posting but I seem to have hit a wall.
Basically I have a recordset that I want to loop through.
Within each loop I want to set VARIABLES from certain feilds within the Recordset. I then use the variables in a simple copyfile code.
This is the code thus far :-
Set rstWzip = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset, dbReadOnly, dbReadOnly)
If rstWzip.EOF Then
MsgBox ("no records selected")
While Not rstWzip.EOF
DrgNo = rstWzip("DigitalFile")
DrgPath = rstWzip.Fields("Path").Value
SourceFile = DrgPath + DrgNo & ".dwg" ' Define source file name.
DestinationFile = DrgDest + DrgNo & "_Issue_" + DrgIsID & ".dwg" ' Define target file name.
FileCopy SourceFile, DestinationFile ' Copy source to target.
'If FileCopy = Err Then
'SourceFile = DrgPath + DrgNo & ".dgn"
'FileCopy SourceFile, DestinationFile
rstWzip.MoveNext
Wend
End If
AS you can see I have tried different approaches of retreiving the data for Drg No and DrgPath. When I debug the code the values are appearing but the variable returns as EMPTY.
How Can I cure this ???
Thanks in advance.
I have made progress with help on a previous posting but I seem to have hit a wall.
Basically I have a recordset that I want to loop through.
Within each loop I want to set VARIABLES from certain feilds within the Recordset. I then use the variables in a simple copyfile code.
This is the code thus far :-
Set rstWzip = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset, dbReadOnly, dbReadOnly)
If rstWzip.EOF Then
MsgBox ("no records selected")
While Not rstWzip.EOF
DrgNo = rstWzip("DigitalFile")
DrgPath = rstWzip.Fields("Path").Value
SourceFile = DrgPath + DrgNo & ".dwg" ' Define source file name.
DestinationFile = DrgDest + DrgNo & "_Issue_" + DrgIsID & ".dwg" ' Define target file name.
FileCopy SourceFile, DestinationFile ' Copy source to target.
'If FileCopy = Err Then
'SourceFile = DrgPath + DrgNo & ".dgn"
'FileCopy SourceFile, DestinationFile
rstWzip.MoveNext
Wend
End If
AS you can see I have tried different approaches of retreiving the data for Drg No and DrgPath. When I debug the code the values are appearing but the variable returns as EMPTY.
How Can I cure this ???
Thanks in advance.