This might be a tricky one, or not.
I have a table with an autonumber Primary Key. Then I have a form that simply shows the records in this table. One of the field in this table is a text field which I like to have automatically generated. The field value will start with an "S" followed by "0000" and then the value of the autonumber primary key field.
So if the primary key for the record is 1, then the text field would be "S00001".
I could have done this if I used the form in Data Entry mode. But I don't. I enter data into this table using an unbound form, and using the following:
Set rst = CurrentDb.OpenRecordset("TableName")
With rst
.AddNew
!FieldName = Me![ControlName]
'and so on
.Update
.Close
End With
Set rst = Nothing
Using this method, update query, or any other method other than using the bound form with DataEnty mode; how can I have the value of this text field generated as explained above?
I know this is an easy one for you geniuses out there.
Thanks.