Ronel has attended:
Access Introduction course
Field properties in table
example
Would like the product id to always start with P and followed by 3 auto numbers.
RE: field properties in table
Hi Ronel,
Thank you for your post and welcome to the forum, in answer to your request,
You won't be able to combine text with an autonumber field. What you can do is create a unbound text box that will concantenate the text you want to display and the autonumber field number and use that to display to the user.
In your forms On Current event you can keep the unbound text box in sync with the records displayed.
UnboundTextBox.Value = "Your Text (P)" & " " & [autonumberfield]
In your underlying table the product ID would have to be a standard autonumber.
If however you do not wish to use an AutoNumber ID then you can utilise a combination of the Input Mask and the Validation Text boxes: in the Input Mask box type >L000
and in the Validation Rule type Like "P???"
If you then apply the Primary Key to this field and ensure No Duplicates it will allow you to only enter P followed by three numbers.
I hope that has helped, sorry about the AutoNumber though.
regards Pete
.