Solved

Access2010:  3 Combos on Continuous Forms

Posted on 2013-10-31
7
292 Views
Last Modified: 2013-11-06
I have a continuos form that I wish to have 3 combo boxes on:
cboFrom
cboItem
cboTo

The cboFrom and cboTo  are from a lookup table (LKUpList).
The cboItem is from a LkUpItem table
A third table will contain the results - Base Table. The BaseTable has the following fields:
ID
ItemDesc
FromABV
ToABV
The user should be able to add to this table and can also change the FromABV and ToABV by way of the associated Combo Boxes (cboFrom, cboTo).

The form should show the the previous items along with their respective From/To as are in the Base Table. Since each item in cboItem can have multiple From/To combinations, there will be multiple Base Table records for a given Item potentially.

I'm having a hard time retrieving the previous records from the BaseTable while at the same time allowing the user to create a new entry.

I dont know where to place the event that will handle any code I may need to write to accomplish this.
I need this in a continous form because I'm using it as a subform.
I've included a very basic sample to give you an idea...
test.accdb
0
Comment
Question by:GNOVAK
  • 3
  • 2
  • 2
7 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 39615175
try using the Beforeupdate event of the form..

you can use the controls (combo box)  OldValue property to get the previous value.
like this

me.cboFrom.oldvalue
0
 
LVL 31

Assisted Solution

by:Helen_Feddema
Helen_Feddema earned 100 total points
ID: 39615615
Unbound controls on continuous forms display the same value on all rows, which is probably not what you want.  What is the reason for using a continuous form?  You would find it easier to do what you want on a regular (Single) form.
0
 

Author Comment

by:GNOVAK
ID: 39616550
The reason for the continuous form is that it is going to be used as a subform for, in this example, say a client. There are many other activities that need to go on for this client.

If I need to bind the CBOs to the Base Table, the problem becomes more....interesting.
How do I present a list from LkUpList on two of the boxes and LkupItem in the center CBO?

I know there's a way and it's the CBO boxes that always have me confused.
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 119

Assisted Solution

by:Rey Obrero
Rey Obrero earned 200 total points
ID: 39616705
<How do I present a list from LkUpList on two of the boxes and LkupItem in the center CBO?>

you will use the Row Source property of the combo boxes


Row Source  Select f1,f2 from tablex
Row Source Type  Table/query
0
 

Accepted Solution

by:
GNOVAK earned 0 total points
ID: 39617006
Finally figured it out. I had to revise the tables and the primary keys a bit:
Solution:
      The LkUpItem Table should have a primary Key on ID
      The Lk_UpList Table needs a primary key on the Lk_ABV – whatever is in the BaseTable
      A Query should be made with Left joining the lookup tables to the base table:
(SELECT BaseTable.FromABV, Lk_UpList.LK_DESC AS FromDesc, BaseTable.ItemID, LkUpItem.ItemDesc, BaseTable.ToABV, Lk_UpList_1.LK_DESC AS ToDesc
FROM ((BaseTable LEFT JOIN Lk_UpList ON BaseTable.FromABV = Lk_UpList.LK_ABV) LEFT JOIN Lk_UpList AS Lk_UpList_1 ON BaseTable.ToABV = Lk_UpList_1.LK_ABV) LEFT JOIN LkUpItem ON BaseTable.ItemID = LkUpItem.ID;)

The form uses the Query as it’s source
The combo boxes each use their respective lookup tables as their Row source.  The Control Source is the respective fields from the Base Table – From, To, Desc
0
 
LVL 31

Expert Comment

by:Helen_Feddema
ID: 39617481
A datasheet subform would not have the problem with unbound controls that you have with a CF subform.
0
 

Author Closing Comment

by:GNOVAK
ID: 39626791
Thanks everyone.
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now