VBA to avoid duplicate supplies item (1 Viewer)

hfsitumo2001

Member
Local time
Today, 07:13
Joined
Jan 17, 2021
Messages
365
you just change txt_ItemCode in the code with ItemCode.
you also need to Rebuild your BeforeUpdate event since the event is for
txt_ItemCode and not for ItemCode textbox.
As simple as that?, will it not confused because the name of the form field is the same as the name of the table field?.

Thank you,

Frank
 

Gasman

Enthusiastic Amateur
Local time
Today, 15:13
Joined
Sep 21, 2011
Messages
14,306
Use Me. In the code Access will then know you are talking about the control, not the field.
 

hfsitumo2001

Member
Local time
Today, 07:13
Joined
Jan 17, 2021
Messages
365
you just change txt_ItemCode in the code with ItemCode.
you also need to Rebuild your BeforeUpdate event since the event is for
txt_ItemCode and not for ItemCode textbox.

Thank you Arnel, it works perfectly. I did it on my testing database.

Thank you very much

Frank
 
Last edited:

hfsitumo2001

Member
Local time
Today, 07:13
Joined
Jan 17, 2021
Messages
365
you just change txt_ItemCode in the code with ItemCode.
HI Arnel,
In reference to Pat's comment about RI ( Referential Integrity) in my database, I want to try to change the control name to be "txt_ItemCode". But since my database is already go live since Mar 2021. What do you think that I am so careful in order not to have a problem on my database.

My testing database is non split one, while I have made much form modifications in my live database ( the split one). Can I import the forms & Reports from my live database and replace it?, I think this is the best way.

Thank you for your advice.

Frank
 

Users who are viewing this thread

Top Bottom