How can I prefix an autonumber with a bit of text?
I want to add records, using the Autonumber as the ID, but I want to prefix the value with "BUS ", so the record ID becomes BUS 1, BUS 2 etc etc.
Don't think you can, unless you use two fields and concatenate them. I would not use Autonumber for this anyway. Best to write code to establish last number used and increment it, then make it a string and add the 'BUS ' part in code as well. Have fun! )
Just a question. Is it crucial that the autonumber part is always consecutive, i.e. no gaps in the sequence. If so then don't use autonumber - it will put gaps in in certain situations and it is a pain to get it to always do what you want.
If this is not an issue, however, then autonumber is the easy way to do it. Have fun! )
#Name? means that the control can't find the data from the recordset. Check the ControlSource property of your control(s) and/or the RecordSource property of the form to make sure it is getting access to the data. Also, is the form set to input a new record, e.g. AllowAdditions = True, DataEntry = True? Any of these could lead to this error. Have fun! )
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.