Need more help with combo box

  • Thread starter Thread starter Marie
  • Start date Start date
M

Marie

Using Access 2000. I have a samples form (which is used to
populate the samples table--which joins many other tables)
with the following features: All of the tables or queries
are linked via a query which is the Samples Input Form's
data source. So when I type in the customer ID, address
fields, etc. populate from the customer table. When I
enter the salespersons number, his/her first and last
names populate those fields. Etc. Now here is my problem,
on this form, I have an actions combo box that gets it
list from the Actions table. Records in the table that are
listed are Sample requested, Sample shipped, Customer
notified, Salesperson notified. But sometimes I want to
enter something in this field that I want to populate the
action field of the samples table, but don't want to
become part of the Actions table because it may never be
needed again. Should I add it to the actions table anyway
or can I use the combo box to "send" this uncommon value
to the action field of the samples table without adding a
record to the actions table?
Hope this makes sense. I explained it the best I could.
Thanks for you help.

Marie
 
Marie said:
Using Access 2000. I have a samples form (which is used to
populate the samples table--which joins many other tables)
with the following features: All of the tables or queries
are linked via a query which is the Samples Input Form's
data source. So when I type in the customer ID, address
fields, etc. populate from the customer table. When I
enter the salespersons number, his/her first and last
names populate those fields. Etc. Now here is my problem,
on this form, I have an actions combo box that gets it
list from the Actions table. Records in the table that are
listed are Sample requested, Sample shipped, Customer
notified, Salesperson notified. But sometimes I want to
enter something in this field that I want to populate the
action field of the samples table, but don't want to
become part of the Actions table because it may never be
needed again. Should I add it to the actions table anyway
or can I use the combo box to "send" this uncommon value
to the action field of the samples table without adding a
record to the actions table?
Hope this makes sense. I explained it the best I could.
Thanks for you help.

You can set the combo box's LimitToList property No, which would let
users enter values that aren't in the list, while still making it easy
to choose items from the list. The only trouble with this approach is
that it makes it possible for them to enter all kinds of misspelled
actions by mistake. You could try it that way and see if it works out
well enough in practice.

Another possibility is to set it up as described above, but add code in
the combo box's BeforeUpdate event that checks whether the entered value
is in the list. If it isn't you can display a message asking the user
if that's what they really meant. If they click Yes, you allow the
update to proceed (without adding the action to the list). If they
click No, you cancel the update of the combo box.
 
-----Original Message-----


You can set the combo box's LimitToList property No, which would let
users enter values that aren't in the list, while still making it easy
to choose items from the list. The only trouble with this approach is
that it makes it possible for them to enter all kinds of misspelled
actions by mistake. You could try it that way and see if it works out
well enough in practice.

Another possibility is to set it up as described above, but add code in
the combo box's BeforeUpdate event that checks whether the entered value
is in the list. If it isn't you can display a message asking the user
if that's what they really meant. If they click Yes, you allow the
update to proceed (without adding the action to the list). If they
click No, you cancel the update of the combo box.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
Thanks for the speedy reply. I do have Limit to List as
No; however, when I try to type in something that is not
on the list, I get this message: "The Microsift Jet
database engine cannot find a record in the
table "tblSampleActions" with key matching field
(s) 'fldActions'.

Marie
 
Marie said:
Thanks for the speedy reply. I do have Limit to List as
No; however, when I try to type in something that is not
on the list, I get this message: "The Microsift Jet
database engine cannot find a record in the
table "tblSampleActions" with key matching field
(s) 'fldActions'.

Do you have an enforced relationship defined between the Samples table
(or whatever it's called) and tblSampleActions? If so, you will not be
able to store a value in this field that isn't in tblSampleActions. But
if this is the problem, you can probably solve it by not enforcing the
relationship.
 
-----Original Message-----


Do you have an enforced relationship defined between the Samples table
(or whatever it's called) and tblSampleActions? If so, you will not be
able to store a value in this field that isn't in tblSampleActions. But
if this is the problem, you can probably solve it by not enforcing the
relationship.
Dirk,
Deleted the relationship, and it works like I need it.
Thanks so much for your guidance.
Marie
 
Back
Top