Solved

Access2010:  3 Combos on Continuous Forms

Posted on 2013-10-31
7
296 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 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 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 120

Assisted Solution

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Familiarize people with the process of utilizing SQL Server stored procedures 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 Micr…
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…

772 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