Cliff67
Registered User.
- Local time
- Today, 10:26
- Joined
- Oct 16, 2018
- Messages
- 192
Hello All,
long time no post. So a lot has happened since I last posted here.
I've changed jobs and I'm now in another industry altogether. I'm still putting my Access skills to use here too.
I'm using Access 365 which has been a learning curve so maybe that is the issue
Now down to the issue at hand - I get the dreaded 2465 error
the code is quite simple behind a sub form "BeforeInsert" event
it looks like this
the error is being thrown at the Holdit = Format line.
All it is to do is take the maximum ID number from the table Tbl_Equipment add 1 to the value and format it to look like "T0012" and put it in the subform "Frm_Sub_Equipment field called PatTrackID
for some reason that escapes me Access cannot resolve the field name, any help would be gladly taken
long time no post. So a lot has happened since I last posted here.
I've changed jobs and I'm now in another industry altogether. I'm still putting my Access skills to use here too.
I'm using Access 365 which has been a learning curve so maybe that is the issue
Now down to the issue at hand - I get the dreaded 2465 error
the code is quite simple behind a sub form "BeforeInsert" event
it looks like this
Code:
Private Sub Form_BeforeInsert(Cancel As Integer)
Dim HoldIt As String
HoldIt = Format((DMax("ID", "Tbl_Equipment") + 1), ["T" & '0000'])
[Forms]![frm_Equipment_register]![Frm_Sub_Equipment].Form![PatTrackID] = HoldIt
'Me.PatTrackID = HoldIt
End Sub
the error is being thrown at the Holdit = Format line.
All it is to do is take the maximum ID number from the table Tbl_Equipment add 1 to the value and format it to look like "T0012" and put it in the subform "Frm_Sub_Equipment field called PatTrackID
for some reason that escapes me Access cannot resolve the field name, any help would be gladly taken