CharlesWhiteman
Registered User.
- Local time
- Today, 18:29
- Joined
- Feb 26, 2007
- Messages
- 421
Hi All, I am using the following code which, combined with another bit of code which takes the first two letters of a company name, to generate an account number.
If Me.NewRecord Then
On Error Resume Next
Me!CompanyCode = Nz(DMax("[CompanyCode]", "TblDatabase"), 0) + 1
End If
What would be better is if the Db can look at the a/c number AB001 and if there are no other AB's give me a/c number AB002
any pointers most welcome and thanks.
If Me.NewRecord Then
On Error Resume Next
Me!CompanyCode = Nz(DMax("[CompanyCode]", "TblDatabase"), 0) + 1
End If
What would be better is if the Db can look at the a/c number AB001 and if there are no other AB's give me a/c number AB002
any pointers most welcome and thanks.