Just realised I also left out the backslash after Test in my last post !!!
As you did in the intro to your latest post - its fated
Try this as a simpler alternative using a DAO recordset:
Code:
Private Sub GetPhoto()
Dim rs As DAO.Recordset
strsql = "SELECT IDWFNAME,IDWLNAME,IDWCARDNUM,IDWPhotofield1 FROM IDWSCHD WHERE IDWPhotofield1 is not null"
Set rs=CurrentDB.OpenRecordset(strSQL,OpenDynaset)
With rs
.MoveFirst
DoUntil .EOF
.Edit
!IDWPhotofield="C:\Test\" & !IDWFNAME & "_" & !IDWLNAME & "_" & !IDWCARDNUM & ".jpg"
.Update
MoveNext
Loop
.Close
End With
Set rs = Nothing
End Sub
Or much easier still, just use an UPDATE query instead of a recordset:
Code:
UPDATE IdwSchd SET IdwSchd.IdwPhotoField1 = "C:\Test\" & [IDWFNAME] & "_" & [IDWLNAME] & "_" & [IDWCARDNUM] & ".jpg"WHERE (((IdwSchd.IdwPhotoField1) Is Not Null));
This will be FAR faster than a recordset especially if you have a lot of records to update