Hi,
I would like to join autonumber field and a text and save it to another field.
For example
Autonumber 1 2 3 44
test_field w1 w2 w3 w44
tried "W"+""[autonumber] in test_field format, but its not working. Please help
Thanks in advance
Hi,
I would like to join autonumber field and a text and save it to another field.
For example
Autonumber 1 2 3 44
test_field w1 w2 w3 w44
tried "W"+""[autonumber] in test_field format, but its not working. Please help
Thanks in advance
Where are you getting the values from, a query? If so, I think a calculated query field would work: Expr1: "W" & Cstr([NameOfAutonumberField]). You don't have to display the two fields that you are concatenating if you don't want to see all 3 of them. Of course, you could give the field a more meaningful name than Expr1.
Not from query, it is updated from form to table. I need to create a job number prefix "W" followed by autonumber.
Tried "W"& in table -> autonumber -> format, it worked fine, but when I select this autonumber in form using a comboxbox, it shows "invalid format"
To the best of my knowledge, a table autonumber field can only be a long integer type, so I fail to see how you could preface it with a letter. Unless I misunderstand and you're creating a concatenated field in the table (which I would not do).
OK then - more info needed about the form.
Is it bound to a query or directly to the table?
Are you using it to add or edit records (or both)?
Is it a single form or datasheet or what?
Regardless, I think your table needs a field of text type to hold the concatenated value.
It is bound directly to table,
And I want to edit the record from form, when the added a combo box to edit/update the record it is not working.
When I select the jobnumber using combo box, it should auto fill all the fields in the form and user could update as needed.
I'm not sure I can help you. I ask 3 questions, you answer 1. I have no idea what you're working with.
Best I can say is, on the After_Update event for the combo box, write some code that alters the values in the controls you want to update.
Or base your form on a query instead, and requery the form using the combo box value that you seem to be able to generate now. That will automatically 'refresh' what you see in the form controls.
Like micron, I am confused with what you are trying to do. Can you tell us in plain English business terms (no Access jargon) what you are trying to do? There may be some options. But we won't know until we're all clear on what it is you are trying to do.
An autonumber is a unique identifier. Why do you want to prefix it with an alphabetic? In business terms?
In the table definition, for your [test_field] properties, set a default value of:
Code:="W" & [AutonumberFieldName]
Before proceeding, you should read this:
Autonumbers--What they are NOT and What They Are
http://www.utteraccess.com/wiki/index.php/Autonumbers
tried ="W" & [ID]
but gives error on saving "the database engine does not recognize either the field ID in a validation expression, or the default value in the table "table_name"
Sorry, will will explain what im trying to do
Would like to create a sequential job number in the format W10, W11. The numeric part increments everytime.
So I created a new column "jobnumber" and trying to set the default value as "W+[ID]"
Why do you want "W" as leading character on sequential job number?
Can you tell us more about the business this database will support?