473,406 Members | 2,549 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.

Filling multiple fields in a form from one combo box looking for values

I have a customer order database and I need to pull a customers
information, ie first name, last name, address, city, state, zip,
phone, etc, into the oder table. i don't know how to go about making
this work...

Jun 8 '06 #1
6 8327

<fs*************@yahoo.com> wrote in message
news:11*********************@g10g2000cwb.googlegro ups.com...
I have a customer order database and I need to pull a customers
information, ie first name, last name, address, city, state, zip,
phone, etc, into the oder table. i don't know how to go about making
this work...


You don't. Insert the primary key of the customer into the assigned foreign
key of the order table. Search the Internet on normalisation or the 3rd
normal form.

Jeff
Jun 8 '06 #2
Jeff Smith wrote:
<fs*************@yahoo.com> wrote in message
news:11*********************@g10g2000cwb.googlegro ups.com...
I have a customer order database and I need to pull a customers
information, ie first name, last name, address, city, state, zip,
phone, etc, into the oder table. i don't know how to go about making
this work...


You don't. Insert the primary key of the customer into the assigned foreign
key of the order table. Search the Internet on normalisation or the 3rd
normal form.


I can see a reason for doing this actually -- for orders, you want a
history of what address a particular order actually went to, even if
the person later changes their address.

http://www.blueclaw-db.com/comboboxl..._combo_box.htm
shows an example of how to fill other text boxes from columns in a
combo box.

Basically, set control source to use the column property of a combo box
followed by a number.

--Sarah Schreffler

Jun 8 '06 #3
I did the blue claw thing... Thanks Sarah. How do I have it save it in
that field? Right now it just shows it on the form, however, I need it
to permanently save that information to the fields in the order table?
Sarah Schreffler wrote:
Jeff Smith wrote:
<fs*************@yahoo.com> wrote in message
news:11*********************@g10g2000cwb.googlegro ups.com...
I have a customer order database and I need to pull a customers
information, ie first name, last name, address, city, state, zip,
phone, etc, into the oder table. i don't know how to go about making
this work...


You don't. Insert the primary key of the customer into the assigned foreign
key of the order table. Search the Internet on normalisation or the 3rd
normal form.


I can see a reason for doing this actually -- for orders, you want a
history of what address a particular order actually went to, even if
the person later changes their address.

http://www.blueclaw-db.com/comboboxl..._combo_box.htm
shows an example of how to fill other text boxes from columns in a
combo box.

Basically, set control source to use the column property of a combo box
followed by a number.

--Sarah Schreffler


Jun 8 '06 #4
Your point is correct, but setting controlsource to the column of the
listbox or combobox will not store the data in the order table. By
definition, if the controlsource is the column of a control it cannot be a
field in a table.

If you're adding your record in code it would be along this line:

with rstOrder
.addnew
.fields("CustomerName") = me.cbo.Customer.column(COL_NAME)
.fields("Address") = me.cbo.Customer.column(COL_ADDRESS)
.fields("Phone") = me.cbo.Customer.column(COL_PHONE)
.fields("Email") = me.cbo.Customer.column(COL_EMAIL)
end with
The arrangement here assumes that you define a series of constants
(COL_NAME, etc) that identifiy the columns in your combobox that you want
copied to fields in the new record.

A variation is that in an Order subform, within a Customer form, since the
link is CustomerID, you would get the CustomerID the moment you type
anything on the New Line row of the subform. You could use I believe the
BeforeInsert event of the subform to copy the fields similar to code above,
but into controls on the new order row. E.G.:

(code within the subform)

me.txtCustomerName = me.parent.txtCustomerName
me.txtAddress = me.parent.txtCustomerName
me.txtWhatever = me.parent.txtWhatever

The point about wanting to make a snapshot of the name, address, phone,
whatever, as they were when the order was logged, is a very good point.

Another solution is to have address in table separate from the customer, so
that you can have as many as you need, and just mark the current one. then
you store the foreign key to that address record and not the text.

There are advantages and disadvantages both ways. You have to decide what
will work for you within time and budget constraints.
Jun 8 '06 #5
Ok. I have the contact list with first name, middle initial, Last name
address, city, state and zip. They need to be assigned to a buyer and
seller under the same fields but with B1, B1, S1 and S2 standing for
the buyers and sellers of the items. I need them stored because people
change addresses but the contact list will be kept current so we can
send mail to them at new addresses but still know where the item went.
Im not the best at code and can do basics. Thanks for everyones
help!@!!
w_a_n_n_a_l_l_-@-_s_b_c_g_l_o_b_a_l._n_e_t wrote:
Your point is correct, but setting controlsource to the column of the
listbox or combobox will not store the data in the order table. By
definition, if the controlsource is the column of a control it cannot be a
field in a table.

If you're adding your record in code it would be along this line:

with rstOrder
.addnew
.fields("CustomerName") = me.cbo.Customer.column(COL_NAME)
.fields("Address") = me.cbo.Customer.column(COL_ADDRESS)
.fields("Phone") = me.cbo.Customer.column(COL_PHONE)
.fields("Email") = me.cbo.Customer.column(COL_EMAIL)
end with
The arrangement here assumes that you define a series of constants
(COL_NAME, etc) that identifiy the columns in your combobox that you want
copied to fields in the new record.

A variation is that in an Order subform, within a Customer form, since the
link is CustomerID, you would get the CustomerID the moment you type
anything on the New Line row of the subform. You could use I believe the
BeforeInsert event of the subform to copy the fields similar to code above,
but into controls on the new order row. E.G.:

(code within the subform)

me.txtCustomerName = me.parent.txtCustomerName
me.txtAddress = me.parent.txtCustomerName
me.txtWhatever = me.parent.txtWhatever

The point about wanting to make a snapshot of the name, address, phone,
whatever, as they were when the order was logged, is a very good point.

Another solution is to have address in table separate from the customer, so
that you can have as many as you need, and just mark the current one. then
you store the foreign key to that address record and not the text.

There are advantages and disadvantages both ways. You have to decide what
will work for you within time and budget constraints.


Jun 8 '06 #6
Still Have no idea how to save it to the query and table???

Jun 9 '06 #7

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

Similar topics

5
by: -elniniol999- | last post by:
I am DESPERATE for a quick reply.. have exhausted my options... i have a table called order details which contains: order id product id product name quantity unit price sale price
3
by: google | last post by:
I have a database with four table. In one of the tables, I use about five lookup fields to get populate their dropdown list. I have read that lookup fields are really bad and may cause problems...
3
by: rquinnan | last post by:
Good Evening all, I would greatly appreciate any assistance on this Access 2003 quandary I'm in. And I do apologize if this has been answered somewhere else, I didn't see one that addressed my...
11
by: dskillingstad | last post by:
I've been struggling with this problem for some time and have tried multiple solutions with no luck. Let me start with, I'm a novice at Access and I'm not looking for someones help to design my...
0
by: AMeador | last post by:
I am new to writing apps that use a database in general and in .NET. I have read about how to use SqlCommands and executing strait SQL for inserts, selects, etc... I have also read about datasets &...
2
by: visionstate | last post by:
Hi there, I am working on a form that uses 3 text boxes and 3 combo boxes. When any data is entered into any of these, I click a command button and this requeries a sub query in the form and...
2
by: fstenoughsnoopy | last post by:
I have a customer order database and I need to pull a customers information, ie first name, last name, address, city, state, zip, phone, etc, into the oder table. i don't know how to go about...
4
by: Dave White | last post by:
Hello Everyone, I have created two tables to track my students' lessons. Each student is responsible for most, but not all. of the lessons. I've tried a junction table but I can't figure out...
6
by: Dave | last post by:
On my form I have combo boxes. These combo boxes, after updating them, populate respective listboxes that are located below the combo boxes on the same form. I am trying to use a "generate...
1
by: Jason Northampton | last post by:
Hello This is the first time I've used a discusion forum and up until now I have managed to use and or modify VB code from the various sites on the web, until now! This is a simple problem and I...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.