PC Review


Reply
Thread Tools Rate Thread

default value from another table

 
 
New Member
Join Date: Jan 2010
Posts: 4
 
      7th Dec 2010
I have (amongst others) two tables called supplier and contacts. Each supplier can have many contacts within it. Most contacts, but not all will have the same address as the supplier so how can I automatically populate the address fields of the contact with supplier address information, so users only need to overttype the information if it differs from the main address. (I have a form with suppliers and a sub form for contacts). I have tried typing =[tblSuppliers]![SupAddress] in the default value properties box of the equivalent Address field in the contact field shown in the sub form, but all I get is #name? so I am obviously not doing something right. The tables are linking as the correct supplier number is shown in the supplierID field in the contacts subform.

I would appreciate any help with this. I do have some limited VBA experience if it is easier to do this in code. Many thanks
 
Reply With Quote
 
 
 
 
New Member
Join Date: Jan 2010
Posts: 4
 
      7th Dec 2010
I have been continuing to try and solve this myself and found another post a couple of years old which mentions an update query. I have adapted this, (I think) to reflect my table and just two of the address fields, but I dont know which event in the sub form I need to enter it into. The code I have amended is as follows with Suppliers being the intial data being input and the contact having the option to use this as the default value. If I am on the wrong track, please let me know as I would be grateful for any advice I can get.

UPDATE tblcontacts INNER JOIN tblsuppliers ON tblcontacts.supplierID = tblsuppliers.supplierID SET tblcontacts.contAddress1 =
[
tblsuppliers].[supAddress], tblcontacts.ContAddress2 = [tblsuppliers].[SupAddress1];


Last edited by rosebud; 7th Dec 2010 at 06:13 PM.. Reason: coding came up instead of text
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Default Value =now() in table Steve Stad Microsoft Access Database Table Design 2 1st Feb 2010 04:14 PM
Default Value from Another Table MollyDog8 Microsoft Access Getting Started 2 13th Jan 2009 10:18 AM
Can a record in a table have a default value from another table? gtslabs Microsoft Access Forms 3 10th Dec 2008 09:44 PM
Pivot Table - Default Settings for Table Options =?Utf-8?B?TmFjaG8=?= Microsoft Excel Misc 0 25th Feb 2005 06:05 PM
Default value of a Table in Sql server To default value in DataSet scheme itzik Microsoft ADO .NET 9 15th Feb 2005 01:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:46 AM.