I feel a bit stupid because i'm sure the answer is right in front of me!
I'm behind the curve and looking into upgrading a 2003 database to 2010.
I have not messed with access for a long time so am out of my comfort zone with 2010.
I've let access save the front and back ends in 2007 format but am finding that my code is stopping for silly reasons. The main one today is that .Edit isn't available to me in the method list (among a few others) and i can't figure out how to get it there?
The code below runs fine in 2003 but not in 2010 because .Edit isn't recognised:
Anyone got any ideas on what i should be looking for? Might this be a references issue?
Thanks
I'm behind the curve and looking into upgrading a 2003 database to 2010.
I have not messed with access for a long time so am out of my comfort zone with 2010.
I've let access save the front and back ends in 2007 format but am finding that my code is stopping for silly reasons. The main one today is that .Edit isn't available to me in the method list (among a few others) and i can't figure out how to get it there?
The code below runs fine in 2003 but not in 2010 because .Edit isn't recognised:
Code:
Public Function fNumberContacts()
Dim rstContact As Recordset
Dim cCompanyID As String
Dim nContactCount As Long
Set rstContact = CurrentDb.OpenRecordset("SELECT * FROM tblCompanyContact ORDER BY CompanyID & Rank;")
cCompanyID = ""
nContactCount = 0
With rstContact
If .RecordCount > 0 Then
.MoveFirst
Do While Not .EOF
If !CompanyID <> cCompanyID Then
'New Company - reset counter
nContactCount = 1
cCompanyID = !CompanyID
Else
nContactCount = nContactCount + 1
End If
'Stamp Rank with unique contact ID
.Edit
!Rank = cCompanyID & fPadLeft(CStr(nContactCount), 2)
.Update
.MoveNext
Loop
End If
End With
MsgBox ("Finished!")
End Function
Anyone got any ideas on what i should be looking for? Might this be a references issue?
Thanks