Hi,
I am new to Access and not very experienced in the whole dB field. I promised a friend to create a small database for them to solve some simple issues.
What I am trying to do, is create a table where some values are filled in automatically, from specific records in another table. Since the table where the values are looked up from may change over time, the value needs to be inserted as value, not as reference. The tables have a common, unique field value.
Example:
Table: Fields
WORKED_HOURS: ID_HOUR, CUSTOMER, DEFAULT_HOURS, ACTUAL_HOURS
CUSTOMERS: ID_CUST, CUST_NAME, CUST_DEF_HOURS
The field CUSTOMER in the table WORKED_HOURS is a lookup from the CUSTOMERS table, and contains the value CUSTOMERS:ID_CUST. These two fields are therefore common.
What I want to do now, is automagically insert the value CUST_DEF_HOURS (the number of hours that are scheduled for that customer) into the field DEFAULT_HOURS without giving the data entry person the chance to change that value. It has to be the value and no longer the link to the other table, since the value for CUST_DEF_HOURS may change when the cursomer decides to enter into a different working agreement. The field DEFAULT_HOURS has to be visible in the form that is used to be used for entering the hours, since it needs visual control versus the field of ACTUAL_HOURS in the same record.
I am stumped and cannot seem to find the answer to what sounds like a simple question. Tried using SQL statements, lookup tables and more, but everytime I end up with a field DEFAULT_HOURS that is either empty or gives me an error, but never filled in with the value for CUST_DEF_HOURS that I know exists in the table CUSTOMERS.
Hope that my question is not too simple -although I don't mind admitting to my newby-ness -
Thanks in advance for any pointers,
Patrick
I am new to Access and not very experienced in the whole dB field. I promised a friend to create a small database for them to solve some simple issues.
What I am trying to do, is create a table where some values are filled in automatically, from specific records in another table. Since the table where the values are looked up from may change over time, the value needs to be inserted as value, not as reference. The tables have a common, unique field value.
Example:
Table: Fields
WORKED_HOURS: ID_HOUR, CUSTOMER, DEFAULT_HOURS, ACTUAL_HOURS
CUSTOMERS: ID_CUST, CUST_NAME, CUST_DEF_HOURS
The field CUSTOMER in the table WORKED_HOURS is a lookup from the CUSTOMERS table, and contains the value CUSTOMERS:ID_CUST. These two fields are therefore common.
What I want to do now, is automagically insert the value CUST_DEF_HOURS (the number of hours that are scheduled for that customer) into the field DEFAULT_HOURS without giving the data entry person the chance to change that value. It has to be the value and no longer the link to the other table, since the value for CUST_DEF_HOURS may change when the cursomer decides to enter into a different working agreement. The field DEFAULT_HOURS has to be visible in the form that is used to be used for entering the hours, since it needs visual control versus the field of ACTUAL_HOURS in the same record.
I am stumped and cannot seem to find the answer to what sounds like a simple question. Tried using SQL statements, lookup tables and more, but everytime I end up with a field DEFAULT_HOURS that is either empty or gives me an error, but never filled in with the value for CUST_DEF_HOURS that I know exists in the table CUSTOMERS.
Hope that my question is not too simple -although I don't mind admitting to my newby-ness -
Thanks in advance for any pointers,
Patrick