Re: Problem: combobox, table lookup, adding new record
- From: "Eric D via AccessMonster.com" <u12476@uwe>
- Date: Sun, 15 Jan 2006 15:58:35 GMT
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
.
- Follow-Ups:
- References:
- Prev by Date: Re: Nz(DCount
- Next by Date: Locking fields linked to other tables
- Previous by thread: Re: Problem: combobox, table lookup, adding new record
- Next by thread: Re: Problem: combobox, table lookup, adding new record
- Index(es):
Relevant Pages
|