Something like this
![]()
rs.Open "Select [Job Number], [Inspection Date], [SHIP DATE] " & _ "From FinalInspection " & _ "Where((([Job Number])=1));", Db, adOpenDynamic, adLockOptimistic '< '1' for text field in where clause '< 1 for numeric field in where clause r = 2 ' the start row in the worksheet With rs If Not .EOF Then '<== ' Unique id exisits .Fields("Inspection Date") = Range("B" & r).Value .Fields("SHIP DATE") = Range("C" & r).Value .Update Else '<== ' Unique id does not exisits .AddNew ' create a new record ' add values to each field in the record .Fields("Job Number") = Range("A" & r).Value ' Unique Key .Fields("Inspection Date") = Range("B" & r).Value .Fields("SHIP DATE") = Range("C" & r).Value End If .Close End With Set rs = Nothing Db.Close











LinkBack URL
About LinkBacks
Register To Reply

Bookmarks