Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Control Source Problem

Status
Not open for further replies.

ooch1

MIS
Nov 4, 2003
190
GB
Hello

This is probably not the right forum, but i was hoping someone could help all the same.

I am trying to create a new id for each record created in the form. The way the record is being created is by using the following formula in the text box control source
="DR" & [ID]
The ID is the table autonumber, the prefix is the department id.
In the table there is a further column called [Dept ID], basically i would like this to be updated with the new id, but i obviously the the control source has been taken up with the above formula, so it won't update.
 
Rebind the TextBox control to table field and add the following code to the BeforeInsert event procedure of the form:
[Name of Dept ID control] = "DR" & [Name of ID control]
Anyway it is rarely a good idea to store derived or calculated value in a database.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top