Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Access2010:  3 Combos on Continuous Forms

Posted on 2013-10-31
7
Medium Priority
?
301 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
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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 …
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

609 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