469,647 Members | 1,789 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,647 developers. It's quick & easy.

Auto update data in form from another form

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
Apr 7 '07 #1
1 2867

"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
Apr 7 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Bruce Stockwell | last post: by
5 posts views Thread by Josselin | last post: by
5 posts views Thread by Stephen Plotnick | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.