CharlesWhiteman
Registered User.
- Local time
- Today, 23:42
- Joined
- Feb 26, 2007
- Messages
- 421
Hi All, In My Db I use the following code which generates a unique account number but i need to find a way to achieve the same result in an update query or find best practice to achieve. My current way does the job when manually entering one company at a time but now i need a automated way.
I can import my spreadsheet of companies into a new Tbl and then to an append query to merge them into the main Tbl but need the account number to be generated too.
Chars & Format(Replace(Nz(DMax("[AccountNumber]", _
"tblDatabase", "Left([AccountNumber],2)='" & _
Chars & "'"), 0), Chars, "") + 1, "##000")
I can import my spreadsheet of companies into a new Tbl and then to an append query to merge them into the main Tbl but need the account number to be generated too.
Chars & Format(Replace(Nz(DMax("[AccountNumber]", _
"tblDatabase", "Left([AccountNumber],2)='" & _
Chars & "'"), 0), Chars, "") + 1, "##000")