Solved

Access2010:  3 Combos on Continuous Forms

Posted on 2013-10-31
7
294 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
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.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

919 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

16 Experts available now in Live!

Get 1:1 Help Now