PDA

View Full Version : calculate txt box number trim?



samohtwerdna
01-20-2006, 07:13 AM
Hello again,

I have a perhaps strange idea and wondered if any one could help me with the code to accomplish it.

Two different tables:
I have a main job table that has a jobNumber field and a partNumber field. On another table I have short orders that relate to the jobNumber and partNumber - the shortOrderNumber starts with the jobNumber then adds a (.) followed by the partNumber followed by the unique number of short orders for that job and part.

Example:
jobNumber = 3389
partNumber = 1
shortOrderNumber = 3389.101
shortOrderNumber = 3389.102

This would mean there are two short orders for job 3389 part 1.

My Idea is to have a form for the short orders that will trim the short order number appropriately so I can store the jobNumber and PartNumber that it relates to and also call up other realating info from the main job table that I want to include on my short order form.

Does this make sense??

Any Ideas??

Thanks for the help!:thumb

OBP
01-21-2006, 02:25 PM
No problem, is this for old records as well as new records.

samohtwerdna
01-21-2006, 04:19 PM
No this would just be for new records. But I suppose as a lookup it might work for both.

OBP
01-22-2006, 03:49 AM
The attached database has a form that does what you want. The VBA is in the sortOrderNumber field's "After Update" event procedure.