Assigning a default value to DelCharge

This must be easy - but I have spend ages trying various ways and failing ...

See frmAddCustomers.  (Table is tblCustomers with several joins via Combos)

Click "Add Customer" button in frmAddCustomers
Note the "REGION" field which joins via a combo to tblRegion.

The Region chosen will determine the default delivery charge. [tblCustomers].[DelCharge]

Simply after the "Region" is chosen I want to set [tblCustomers].[DelCHarge]=[tblRegion].[DeliveryCharge].

(I have tried numerous ways to do this but am failing badly!)
Patrick O'DeaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill RossProgrammerCommented:

The file is corrupt.  Pelase repost and I'll try to help.

Bill RossProgrammerCommented:

In general you can set a field on a form or write an update to the database.  You cannot set a variable "default" column value in a table.  The effect you can be done easily, though, once you get things set up...

Put the field [tblCustomers].[DelCHarge] on a form with the combo box that has the
[tblRegion].[DeliveryCharge] row source.  Use the after update event of the combo box to set the default.

sub combobox_afterupdate
end sub
Rey Obrero (Capricorn1)Commented:
change the RowSource of the combo RegionCOmbo with

SELECT tblRegion.RegionID, tblRegion.Region, tblRegion.DeliveryCharge
FROM tblRegion;

Set the following
Column count 3
column widths  0;1;0

BOund column 1

now, anytime you want to get the delivery charge, you will just refer to  RegionCombo.column(2)


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Rey Obrero (Capricorn1)Commented:
and, the field DelCharge in table tblCustomers seem redundant, since it is already in tblRegion tied with the Region field in the  tblCustomers
Patrick O'DeaAuthor Commented:
Thanks for the solution!

PS: DelCharge is not really redundant as I need to retain it to cover for the scenario when the region.Delivery changes (any such change should not impact historical data).
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.