Re: Combo boxes in forms



Ron thanks for the response. I got a little confused though. "the .column
property that Dave showed you in the prior post"? Did I miss a response to
my own question? Anyway thanks for the advice I will work on it some more.
--
Bandit


"Ron2006" wrote:

On Dec 11, 6:32 am, Bandit <Ban...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I am using Access 2007. I have several tables created for Purchase Order and
a Purchase Order subform. The purchase order has the purchase order subform
embedded in it. I have several combo boxes in the form. The combo boxes are
for supplies and shipping methods. When I open the combo box and select the
supplier and/or shipping method and close the form the info is saved for that
particular purchase order. When I open the form again, the info is displayed
as it should be. When I go to the underlying table that should be storing
all the information under the suppliers and shipping methods it displays the
id number instead. I am sure this is something very, very simple, but I
can't seen to see what the problem is. Thanks for your help.
--
Bandit

There are multiple things going on at the same time for a combo box.

A) There is a "Bound" Column. This is the ONE field from the query
that will be saved in a field if the combo box is bound to a field in
a table. It is also the field value that will be returned if you
simply address the combobox field (example msgbox me.comboboxname)


B) There is the number of columns which tells you HOW Many fields are
being returned from the query.


C) There is the FIELD Lengths which define how much space (if any)
each field in that combo box will use in the display when you press
the arrow at the end of the combo box. Once you chose one of the
entries, ONLY the first field that has an actual length will show in
the combobox space, and this may or may NOT be the value that is
saved/
stored (item A above)


D) There is the "Limit to List" property. This will say whether or
not
an entry can be made in the box that is NOT in the underlying query
in
the field that is visible. (the first non 0 lengh field returned from
the query.


You can address any and ALL fields of data returned from the query by
using the .column property as Dave showed you in the prior post.


Dave's answer assumed that you were trying to load a separate txtbox
with the information from the selected emplyee. That will work BUT
the
only item that will show in the combo box - given the way you are
pulling the info with the query - is one of the name fields. in which
case you will have a problem if there are multiple entries for the
same single field value showing. (For instance Smith when there are
multiple lastname Smiths in the emplyee list.)


If you want to show all three in the "COMBOBOX" then you will need
to
create a dynamic field in your query that concatenates the three into
a single field and have that be the visible and maybe bound field.


All of the above is why - for an employee table - the employee number
is usually the bound field and first displayed field and the name etc
are also shown with the dropdown BUT then loaded for display into a
separate txt field. That way you will always have the right person's
information saved in your record and displayed EVEN when she gets
married/divorced and changes her name.


And the part number is saved/shown so that when the description
changes your tables still work.

AND that is why - most probably - you see the ID Number of the part in
the data instead of the displayed information from the combobox.

Ron

.



Relevant Pages

  • Re: Query to populate combobox with names of tables, only if they contain data
    ... my case, I wanted to not display the names of empty tables at all, so I ... SELECT "data-chiroptera" AS TableName, Countas RecordCount ... I have a form with a combobox, populated by names of tables in the ... The source for the combobox was this query: ...
    (microsoft.public.access.forms)
  • Re: Combo box / Subform Question
    ... After the combobox selection is made, ... the query sees the selected record and that one gets displayed on ... "Jeff Boyce" wrote: ... value to find the correct record to display. ...
    (microsoft.public.access.formscoding)
  • Re: Current Row or similar for query-based combo box
    ... Based on a prior post, I have created a form to access my table. ... form.in my combobox query I am able to get the intended result. ... rows that need other values to display will suddenly display blank. ...
    (microsoft.public.access.queries)
  • Re: Blank form
    ... > bound controls on the form to display all fields from the query. ... > I then added a combobox based on a simple query on one other table. ... When the user with full permissions ...
    (microsoft.public.access.security)
  • Re: AllowAdditions=False makes unbound controls blank out when recordcount=0.
    ... If the RecordSource is not a read-only query, one workaround is to allow the ... You can place other controls in the Form Header section and they are ... there are still display problems with those ... > the after update event of the combobox. ...
    (microsoft.public.access.forms)

Loading