I have a form containing three text boxes.
1. ID - Autonumber
2. Item_Name - Text
3. Item_Num - Text
Some of the Items have Item_Num, while some of them not.
I have designed a form containg all these three controls on it. Now What I want is: If the user leaves the Item_Num field blank, it should be filled with the value of ID (Autonumber). I know how to place the value by coding like:
Me.Item_Num.setfocus
if len(me.item_num.text)=0 then
me.item_num.text=me.ID.text
endif
My only problem is finding the right EVENT to write this code in. The event should be the last occuring event of the form while saving this record and moving to the other. I used BeforeInsert, but it is the first ocurring event when u type in a form.
Waiting for your reply.....
1. ID - Autonumber
2. Item_Name - Text
3. Item_Num - Text
Some of the Items have Item_Num, while some of them not.
I have designed a form containg all these three controls on it. Now What I want is: If the user leaves the Item_Num field blank, it should be filled with the value of ID (Autonumber). I know how to place the value by coding like:
Me.Item_Num.setfocus
if len(me.item_num.text)=0 then
me.item_num.text=me.ID.text
endif
My only problem is finding the right EVENT to write this code in. The event should be the last occuring event of the form while saving this record and moving to the other. I used BeforeInsert, but it is the first ocurring event when u type in a form.
Waiting for your reply.....