Why is my combo box not populating in a new record?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've got a combo box coded to populate other controls based on what is
selected in the combo. BUT...it's only working while viewing existing
records. Why is it beeping at me (and I would bet sticking it's tongue out
at me) when I'm trying to populate a new record? I'm sure this is a "duh",
but its just not coming to me.
 
I've got a combo box coded to populate other controls based on what is
selected in the combo. BUT...it's only working while viewing existing
records. Why is it beeping at me (and I would bet sticking it's tongue out
at me) when I'm trying to populate a new record? I'm sure this is a "duh",
but its just not coming to me.

Well, what are the RowSource and ControlSource properties of the
combo?

It's VERY UNUSUAL to use a combo to "populate other controls". You can
do it, and it's sometimes appropriate, but it's NOT the best way to
move multiple fields of data around. Could you explain *what you're
trying to accomplish* (rather than specifically "how do I do this
using multiple columns in a combo box)?

John W. Vinson[MVP]
 
Just to fill in some answers to your questions about row source and control
source, the row source is the source for the list that drops down when you
click the arrow. If you need to select a state in the USA you could have a
States table containing the 50 states. Either the States table or query
based on it would be the row source. If the state abbreviation is to appear
in a field in the form's record source table, then the combo box would be
bound to that field. Pretty much anything that appears on a form (combo box,
text box, check box, command button, label, and so forth) is called a
control. If a control (such as combo box) is bound to a field, then that
field is the control's source (or control source, as it is known in Access).
 
Sorry, I wasn't clear enough.
Here's the scoop. I've got a multi-column combo that has a rowsource from a
customer table. I'm using the columns to "auto-populate" other fields on the
form with customer info (I've tried both the beforeupdate and afterupdate
events). The controlsources for the combo as well as the other fields is a
workorder table. I've done this tons of times for user ease in pulling
customer data. For whatever reason (this was an inherited project that
someone else started) the combo box will only execute on the selection of an
item when I'm looking at an existing record from the workorders table. I was
hoping someone could help get me over the speed-bump in my brain as to why
the combo box won't allow me to select an item when I'm on a new record.

Thanks again.
 
John- given the previous reply, could you suggest a better way to pull
customer data onto a workorder? Thx.
 
Thanks for the reply...I'm pretty sure my controlsource and rowsource
properties are set appropriately. Its situational (see previous reply) as to
why the combobox isn't allowing me to select an item while I'm in a new
record. Just can't figure that one out. Thanks again.
 
Ah. I thought you were asking what are those two things. I thought I could
help out with some general definitions, and leave John Vinson, whose skill
level far surpasses my own, to provide specific guidance.
 
John- given the previous reply, could you suggest a better way to pull
customer data onto a workorder? Thx.

If a Workorder is a printed sheet of paper, then yes - base it on a
Query joining the customer table to the workorder table.

If you just want to see customer information on screen, a Subform
("upside down", with the customer information - the "one" side of the
relationship - on the subform), using the CustomerID as the
master/child link field, might be appropriate.

If you just want to *display* (but not store) three or four fields of
customer information you can use textboxes with Control Source

=cboCustomerID.Column(n)

If you want to store customer information redundantly in the workorder
table.... well, you DON'T want to do that!

John W. Vinson[MVP]
 
Sorry, I wasn't clear enough.
Here's the scoop. I've got a multi-column combo that has a rowsource from a
customer table. I'm using the columns to "auto-populate" other fields on the
form with customer info (I've tried both the beforeupdate and afterupdate
events). The controlsources for the combo as well as the other fields is a
workorder table. I've done this tons of times for user ease in pulling
customer data. For whatever reason (this was an inherited project that
someone else started) the combo box will only execute on the selection of an
item when I'm looking at an existing record from the workorders table. I was
hoping someone could help get me over the speed-bump in my brain as to why
the combo box won't allow me to select an item when I'm on a new record.

Ok... two questions, AGAIN, which you have declined to answer:

What is the RowSource property of the Combo Box? Please post the SQL.

What are the Control Sources of the fields that you are trying to
update?

As noted elsethread - if you are trying to COPY data from the customer
table into the Workorder table, *you should not be doing so*! Storing
data redundantly is NEVER a good idea.

John W. Vinson[MVP]
 
If you wanted the SQL, you should've asked for the SQL. I certainly was NOT
trying to avoid the question. I've solved the problem...it was a duh on my
part. Thank you for triggering the thought to fix it.
 
Back
Top