ChronicFear
Registered User.
- Local time
- Yesterday, 20:19
- Joined
- Oct 18, 2007
- Messages
- 66
I am in the process of creating a custom autonumber (I know, I know, it's not my choice. I'm just following orders). I've got it down so that the number works and increments every time someone opens a form to enter a new transaction. However, I could only get it to work if the text box is unbound. That is fine until I need to save all the data input on the form, including this autonumber. This is a silly question, but how do I tell the form to write to the table? I thought it would be something simple like Table![tblTransactions].[TransactionID] = Me.txtCustNum, but apparently not.
Any ideas? Or, if you see flaws in my logic, suggestions on a better way to approach this?
Thanks,
CF
Background info on the custom autonumber for those who want it:
When the new Transaction form opens, access looks at a table called tblCustAuto. In that table are three fields (key, autonum, and prefix). Access checks Prefix to see if it contains today's date formatted as yyyymd. If it matches, AutoNum is incremented by one. If no match, it changes Prefix to today's date and resets AutoNum to 1. Access then combines the Prefix and the AutoNum and puts them in the unbound textbox TransactionID on the Transaction form that is open.
This is all fine and dandy until I need to save. Hence, my above quesiton.
Any ideas? Or, if you see flaws in my logic, suggestions on a better way to approach this?
Thanks,
CF
Background info on the custom autonumber for those who want it:
When the new Transaction form opens, access looks at a table called tblCustAuto. In that table are three fields (key, autonum, and prefix). Access checks Prefix to see if it contains today's date formatted as yyyymd. If it matches, AutoNum is incremented by one. If no match, it changes Prefix to today's date and resets AutoNum to 1. Access then combines the Prefix and the AutoNum and puts them in the unbound textbox TransactionID on the Transaction form that is open.
This is all fine and dandy until I need to save. Hence, my above quesiton.