Automatic field update

labpanag

New member
Local time
Today, 13:26
Joined
Mar 24, 2025
Messages
3
Good evening
I would like your help.
In the database example below, I want when I put a value in the "Category" field in the "Data" table, the "Color" field of the table to be automatically updated with the corresponding value from the "Color" table.
 

Attachments

Google translate:
Good evening I would like your help.In the following database example, when I put a value in the "Category" field in the "Data" table, I want the "Color" field in the table to be automatically updated with the corresponding value from the "Color" table.Any help is welcome.Thanks in advance.


Please tell us English (use google translate if necessary) what your application is about. A brief overview to put your question into context.
 
If a field can be automatically update, you do not need to store it. Use a query to show the related value.
 
Last edited:
In the database example below, I want when I put a value in the "Category" field in the "Data" table, the "Color" field of the table to be automatically updated with the corresponding value from the "Color" table.
I am assuming you mean store the color name associated with each category in the color field of the Data table. The Data table is the record source of the Frm1. I have no idea why there is a separate color table because there is a color already in the category table. So, it would be easier to just use an After Update event to accomplish what you want. I tried to put the code into your sample database and kept getting an error.

1742861155878.png


I tried creating another form based directly off of the Data table and still got the same error. I ended up recreating the database using a few different names, but it's essentially the same thing. Everything worked fine in the new database sample attached.

It might have had something to do with the foreign language settings that caused the original error.
 

Attachments

Last edited:
I am assuming you mean store the color name associated with each category in the color field of the Data table. The Data table is the record source of the Frm1. I have no idea why there is a separate color table because there is a color already in the category table. So, it would be easier to just use an After Update event to accomplish what you want. I tried to put the code into your sample database and kept getting an error.

View attachment 119086

I tried creating another form based directly off of the Data table and still got the same error. I ended up recreating the database using a few different names, but it's essentially the same thing. Everything worked fine in the new database sample attached.

It might have had something to do with the foreign language settings that caused the original error.
Thank you very much for your help.
 

Users who are viewing this thread

Back
Top Bottom