473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

get values from another table

Hi I wonder if someone can help.

I have a form that has a combo box that I use to select a customer. Ho do I
populate other fields on my form based on the value I have selected from the
conbo box. I want access to put the client details in automatically.

Thanks
Nov 12 '05 #1
1 10022
"home" <re**@telkomsa.net> wrote in message
news:bo**********@ctb-nnrp2.saix.net...
Hi I wonder if someone can help.

I have a form that has a combo box that I use to select a customer. Ho do I
populate other fields on my form based on the value I have selected from the
conbo box. I want access to put the client details in automatically.


Actually, in most circumstances you would not want to do this. You would
instead use a subform, query, or other lookup method so that when looking at the
record you *see* all of the customer details, but only store the CustomerID
value that you entered from the ComboBox.

If this were a Sales Order for example, you have already stored the Customers
information once (where it belongs) in the Customers table. Why copy that data
over for every Order record. If you do that then any time your customer's data
changes, the data in all previous Orders is now incorrect.

I would recommend one of the following methods to display the details. If it is
going to be all clumped together somewhere on the form (which is typical), then
create a small sub-form with the details like Address, phone, etc.. and add it
to your current form using the CusotmerID field as the Master/Child Link.
Whenever you change the CustomerID then you will automatically see that
customer's *current* data.

If you need to disperse the detail data around on your form then add all of the
columns you need to the ComboBox you currently have (you can make them hidden if
you like). Then add TextBoxes to the form with ControlSource properties similar
to...

=CustomerComboBox.Column(1)
=CustomerComboBox.Column(2)
etc..

Columns in ComboBoxes are numbered starting with zero so the above examples are
actually going to display the data in the second and third columns respectively.

Now; if for some reason you actually did want to store the details every time
because you wanted a record of "the company details at the point in time when
the record was created", then you would use a variation on the second method
above. You would bind your other TextBoxes to fields in your table and in the
AfterUpdate event of the ComboBox use code similar to...

Me!CustomerCity = Me!CustomerComboBox.Column(1)
Me!CustomerState = Me!CustomerComboBox.Column(2)
etc..

This method grabs the data from the hidden columns and inserts it into your
bound TextBoxes so it will be saved with each record.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Berend | last post by:
I am trying to pass multi values into a where clause with an in clause in a store procedure to use in a Crystal report. This can change depending on the user. Maybe there is another way to pass...
26
by: Agoston Bejo | last post by:
I want to enforce such a constraint on a column that would ensure that the values be all unique, but this wouldn't apply to NULL values. (I.e. there may be more than one NULL value in the column.)...
1
by: Programmer | last post by:
Hi All Here is my problem I'm using a SQLDataAdapter and DataSet I use the method FillSchema(myDataset, SchemaType.Source) The problem is that when i Check the default Values of the Dataset...
2
by: Wilder | last post by:
I'm trying to update a field in one table with the minimum values of the field in another table. The two tables are linked via a common field. I want to populate a date field in one table with...
5
by: kevinjouco | last post by:
Hello Have searched the group for a solution to the following problem without success: Table 1 has Ref No (No Duplicates) & Min Max Value Fields ie Ref No 1 Min 1 Max 10 Ref No 2 Min 11 Max...
8
by: Chris A via AccessMonster.com | last post by:
I have an interesting problem that I have yet to come accross that I can't change data structure on because it is an export from filemaker I am reformatting for another dept. anyway. I have a table...
4
by: J | last post by:
I am editing a pre-existing view. This view is already bringing data from 40+ tables so I am to modify it without screwing with anything else that is already in there. I need to (left) join it...
1
by: socc16e | last post by:
I have an excel sheet that I have imported into SQL 2000 and I need to match the values in one to the values in another and have them output the matching codes to a separate table or file. After...
0
by: Mark C. Stock | last post by:
"Mark C. Stock" <mcstockX@Xenquery .comwrote in message news:... | | "Berend" <Berend.Brinkhuis@evatone.comwrote in message | news:bdd9ac20.0401271301.22cdb65e@posting.google.com... | | I am...
2
dlite922
by: dlite922 | last post by:
I have a permission table that gives a userID permission to a module and the any actions within that module. What I want to do is duplicate his permissions to another user. Permission table...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.