?
Solved

Access2010:  3 Combos on Continuous Forms

Posted on 2013-10-31
7
Medium Priority
?
300 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
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 300 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 600 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

762 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