Hi All,
Having a little brain ache with a small update procedure, I have a field in each line of data that shows the visit number,
I casn set the Number 1 visit but thereafter nothing I can think of seems to work for the 2's and 3's etc, my latest attempt is
Private Sub UpdateVistRecord()
On Error GoTo Err_TagRecord
Dim Myrs As DAO.Recordset
Dim MyDb As DAO.Database
Dim VisitTag As Integer
Dim CurID As Integer
Set MyDb = CurrentDb()
Set Myrs = MyDb.OpenRecordset("tblMyTable", dbOpenDynaset)
With Myrs
CurID = !VistTag
Do While Not .EOF
If !CurID = 1 Then
.MoveNext
Else
If !CurID = "" Then
.Edit
!CurID = 2
.Update
.MoveNext
End If
End If
.MoveNext
Loop
End With
Exit_TagRecord:
On Error GoTo 0
Myrs.Close
Set Myrs = Nothing
Set MyDb = Nothing
Exit Sub
Err_TagRecord:
MsgBox "Error No: " & Err.Number & vbCr & _
"Description: " & Err.Description
Resume Exit_TagRecord
End Sub
Also is there a way that you can check a field value say CustID gainst the one before it like you can in excel
Cheers
JB