Re: Problem: combobox, table lookup, adding new record



Rob,

As I just moved and have purchased many things for the new house, I'm
deducting state sales tax this year and think I've done something similiar to
what you are doing.

My form prompts for the date, then the store (combo box) where I purchased
the item. After selecting the store, my next field will display criteria
(your short names) based on the store entered. If you don't have a table that
identifies the stores you shop at, you might have to modify your table layout
to address this.

The biggest issue is being able to add new items to the short name table "on
the fly".

If you use a combo box to list the short names, you can pull the ItemID from
that table, just hide it when displaying the data in the combo box. In the
OnExit of this combo box, check what was entered. If not listed in the short
name table, my code would prompt me to add or skip. If I say add, my code
would add the short name, along with the ItemID (or whatever field that links
the data to the other table), to the appropriate table. You would probably
have to code for null, etc., here.


I've done this to a project at work also. I select the equipment TYPE I want
to work with... then the next combo box displays the valid machines in that
TYPE group. The user makes a selection and a form is displayed for user input
that is based on the equipment selected. No auto-add here though. Trying to
avoid user " awshucks ".

Rob wrote:
>I have a form for entering "Items" from receipts. Each Item has a
>name, but it also has one or more Short Names -- the names that are
>actually written on the receipt. Here is my problem: I have a nice
>continuous form for entering new items right now, but I want to be able
>to add a short name to an item (since it may have many--the same item
>may have different short names at different stores) on the same form as
>the rest of the items properties.
>
>This is what I was thinking: a Combo Box that contains all the short
>names currently assigned to the current item, with the ability to write
>in an item not in the combobox list, and have it be added to the "short
>names" table for the current item.
>
>I am having trouble figuring out what my control source, row source,
>bound column, etc, should be in this case. Here is the setup:
>
>Item Table
>-ID
>-Name
>-Description
>-etc
>
>ItemShortNames Table
>-ID
>-ItemID
>-Short Name
>
>Again, I want my combobox to contain a list of all the different short
>names assigned to the particular item, inside a continuous form (for
>easy entry and editing of items--so I don't think subforms will work)
>with the ability to type in a new short name in the combobox at will.
>
>Please help. I've been working on this problem for a long time and I
>can't figure it out...it's really slowing me down.
>
>Thanks
>
>Rob

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200601/1
.



Relevant Pages

  • Re: Missing something basic - Combobox updating table
    ... I have a form that uses the query as the record source called ... The form only contains a single combobox so someone can select ... Selecting any name other than Timmy, ... display the names. ...
    (microsoft.public.access.forms)
  • Newbie: help with datareader
    ... - I want to construct an interface with a few radios, listboxes etc so that ... a user can, by selecting some or all of them, dynamically create an SQL ... ListView or listbox etc. that will be needed to display the result. ... Remember that I need to store the result as well, ...
    (microsoft.public.dotnet.languages.vb)
  • Newbie: help with datareader
    ... - I want to construct an interface with a few radios, listboxes etc so that ... a user can, by selecting some or all of them, dynamically create an SQL ... ListView or listbox etc. that will be needed to display the result. ... Remember that I need to store the result as well, ...
    (microsoft.public.dotnet.framework.adonet)
  • RE: Combobox Additem not holding data?
    ... it will never store the item permanently, since when you add an item at ... > I have a combobox which I am adding an item to at runtime if the item is not ... If I add an item at design time that item will always ... > display, how come it is not displaying when adding item at runtime? ...
    (microsoft.public.vb.general.discussion)
  • choosing linestyles with a combobox
    ... I'm trying to let a user choose a linestyle by selecting one out of a combobox. ... I try to display a preview line in each item of the combo. ... private class LineCellRenderer extends JLabel implements ListCellRenderer { ...
    (comp.lang.java.gui)