"Rodney Frisard" <rf******@cox.netwrote in message
news:kl********************************@4ax.com...
Can anyone help me get this working.
table1 has 3 field, CustId, CustName, CustRate
table2 has 7 fields TimeId, TimeCustId, TimeCustName, TimeDate,
TimeStartTime, TimeEndTime, TimeCustRate, TimeRemaks
Both forms work great by them selves.
Problem -- When I enter table2 - TimeCustId, I want the 2 fields
TImeCustName and TimeCustRate to be automatically update with the
CustName and CustRate from table1.
Looking for a quick and "CLEAN" way of doing this.
Thanks,
Rodney
Remove the TimeCustName and the TimeCustRate fields from table2 because this
is not good normalisation practice. You may need to keep the TimeCustRate
field in table2 if you need to keep a history of what that customers rate
was at the time of that transaction if the customer's rate changes over
time.
If you remove those two fields in table2, create a form using table2 as its
source and bind the 6 remaining fields: TimeID, TimeCustID, TimeDate,
TimeStartTime, TimeEndTime, TimeRemarks. On that form add an unbound text
box and call it txtCustRate with the label Customer Rate. Change its enabled
property to false and its locked property to true.
Change the TimeCustID text box to a combo box and name it cboCustID. For the
recordsource for the combo box choose all 3 fields from table1 and sort the
CustName to ascending. For the column count property of the combo box, set
this to 3. In the combo boxes column width property, set this to
0cm;3cm;1.5cm (or 0";1.2";0.6" if using inches) and change the list width
property to 5cm (1.8"). In the recordsource property of the txtCustRate type
"=cboCustID.Column(2)" without the quotes.
Save your form and when ever you select a customer from the combo box list,
you won't see the customer id and the customer's rate will automatically
appear in the rate field.
Jeff