Combo Box - Add but not edit?

  • Thread starter Thread starter SusanV
  • Start date Start date
S

SusanV

I have a combo box on a form that looks up from a table. If it's bound, then
every time an item is selected, it alters the table so that one item is
overwritten with the chosen item, creating data loss and duplication. If
it's unbound, the data (and subsequent selection list) remain unchanged, but
users can't add items "on the fly."

I can add a button opening a create new record form, but is there a simpler
way to do this so that users can simply type a new item in the combo box and
create a new record? The table has only 2 fields, ClassID (PK, autonumber)
and Class (Lookup values, text).

Seems I'm missing something really simple here (as usual, sigh)

TIA,

SusanV
 
SusanV said:
I have a combo box on a form that looks up from a table. If it's
bound, then every time an item is selected, it alters the table so
that one item is overwritten with the chosen item, creating data loss
and duplication. If it's unbound, the data (and subsequent selection
list) remain unchanged, but users can't add items "on the fly."

I can add a button opening a create new record form, but is there a
simpler way to do this so that users can simply type a new item in
the combo box and create a new record? The table has only 2 fields,
ClassID (PK, autonumber) and Class (Lookup values, text).

Seems I'm missing something really simple here (as usual, sigh)

TIA,

SusanV

What you might be missing is that normally the table supplying the choices is
NOT the same as the table the form is writing to.
 
Hi Rick,

Thanks for replying. Guess I need a second form then to add new records.
Just trying to make (lazy) users happy, didn't think this would be an
issue...

SusanV
 
SusanV said:
Hi Rick,

Thanks for replying. Guess I need a second form then to add new
records. Just trying to make (lazy) users happy, didn't think this
would be an issue...

Hold up there. Add "what" new records? Normally a ComboBox is used to
limit the valid entries in a field or to make those entries faster by
reducing the keystrokes necessary.

Example: On a Sales Order form I have a ComboBox for entering the
CustomerID. This eliminates the need for the user to manually enter the
CustomerID and ensures that only valid CustomerID values are entered. This
involves two tables. A SalesOrders table where I am creating a record (this
is what the form is bound to), and a Customers table where I am pulling the
IDs to populate the list in the ComboBox.

Translating your case to my example are you talking about adding Sales
records or Customer records? If you have a SalesOrder for a brand new
Customer then yes, you would need a form for adding that entry to the
Customers table before you would be able to see and use it in the Sales form
ComboBox.

Another example which might be what you are talking about: On a form a user
is asked to enter some piece of text data. They can enter anything they
want, but I also provide a ComboBox listing uniques instances of past
entries so if their entry has been made before they can save some typing by
selecting it from the list. In this case the ComboBox is "looking back at
itself" in a manner of speaking because the RowSource is using the same
table as the table being written to. In that case your users need do
nothing except make their entry. If they look in the list and it is not
there, they can simply type it manually, but the NEXT TIME someone wants to
make that same entry it will be in the list.

The issue of users writing over an existing entry when their intent is to
make a new entry is really a different subject altogether. That is simply a
matter of users knowing how Access forms and control work. I have had users
who just intuitively thought that ComboBoxes are always a navigation tool so
when they go to an existing record and see a ComboBox they think its purpose
is to take them to the record matching the choice they make and they are
surpised when what it actually does is modify the record they were on.
While a ComboBox *can* be used to navigate that is certainly not its default
purpose and users simply need to be shown that.
 
Well, for the Class thing I referenced there won't be any additions, as it's
simply a modal form which opens the correct switchboard for the user based
on what class he will be working on. So it's moot in that instance, leaving
the control source blank works fine.

But for another project I'm just beginning, a db to track generator service
and repair calls, there are multiple types of filters - Oil, Fuel, And Air.
So I was looking to use cascading combo boxes to select filter type (select
only) which would then bring up another list box manufacturer (select or
add) - as there are dozens of manufacturers - then yet another for the Part
number for that manufacturer (select or add).

Does that make more sense?

Thanks for the help, I've never used this type of control before, so any and
all advice is more than welcome!

SusanV
 
SusanV said:
Well, for the Class thing I referenced there won't be any additions,
as it's simply a modal form which opens the correct switchboard for
the user based on what class he will be working on. So it's moot in
that instance, leaving the control source blank works fine.

But for another project I'm just beginning, a db to track generator
service and repair calls, there are multiple types of filters - Oil,
Fuel, And Air. So I was looking to use cascading combo boxes to
select filter type (select only) which would then bring up another
list box manufacturer (select or add) - as there are dozens of
manufacturers - then yet another for the Part number for that
manufacturer (select or add).

Does that make more sense?

Thanks for the help, I've never used this type of control before, so
any and all advice is more than welcome!

Not sure I follow you. If you want the ComboBoxes to be used to apply
filters for searching then they should not be bound. If they are not bound
then there is no chance that making a selection will change anything.
 
Rick -
Thanks for your patience, and sorry if I'm not clear, this isn't clear to me
myself to tell you the truth. This is what they want when entering new
generator contract info into this database (from an email I got):

"I want to be able to pull the filter info from a drop down list, but if it
isn't there add it without opening another page"

This didn't make any sense to me either, as I would expect that a certain
model would always have the same filters. But the answer I got back was
"Basically, a given model of generator *may* have different filter part
numbers due to modification.Or alternate filter manufacturers, with the
customer having a preference"

So I can't tie the filter part numbers directly to the mfr/model. That were
the case, the air, oil, and fuel filter part numbers would go into the same
table as the Generator make and model (tblGenModels), rather than having to
tie things together between tblCustomerGen, tblGenModels, and tblFilters.

<sigh> Nothings ever simple around here =/

SusanV
 
Back
Top