Assigning a default value to DelCharge

Hi,
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]

WHAT I NEED:
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!)



EE-DELIVERY.zip
Patrick O'DeaAsked:
Who is Participating?
 
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)


0
 
Bill RossCommented:
Hi,

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

Bill
0
 
Bill RossCommented:
Hi,

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
  me!DelCHarge=me.combobox
end sub
0
 
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
0
 
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).
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.