473,662 Members | 2,752 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

cascading combo boxes - help with syntax

56 New Member
I'd like to start off with an apology - I posted a question on a similar matter sometime ago and didn't respond to those who took the time to answer my question. At the time i gave up but have used the responses I got to revisit this now - thanks to those who reposnded originally. I'm nearly there but need help with some syntax (I think).

I am filtering the option in one combo box cboStatus based on the entry to another combo box cboLocalityTeam . cboStatus uses lookup list tlkpStatus with StatusCode (PK), StatusDesc and LocalityCode (FK) while cboLocalityTeam uses lookup tlkpLocality with Localitycode (PK) and LocalityDesc.

I've done the filter with a query qryServiceLooku p:
Expand|Select|Wrap|Line Numbers
  1. SELECT tlkpStatus.StatusCode, tlkpStatus.ServiceDesc, tlkpStatus.LocalityCode
  2. FROM tlkpStatus
  3. WHERE (((tlkpStatus.LocalityCode)=[Forms]![frmSub]![cboLocalityTeam]));
It is requeried to reflect any change to the record with a macro.

frmSub is a subform that sits within frmMain; the above works fine when I open frmSub directly but when I open it within frmMain I get an "'Enter Paramaeter Value' = [Forms]![frmSub]![cboLocalityTeam " error. I assume [Forms]![frmSub]![cboLocalityTeam needs to be changed to reflect that frmSub is a subform within frmMain but I'm not sure and haven't managed to change it successfully. Appreciate any guidance!!
Sep 23 '09 #1
3 2117
NeoPa
32,568 Recognized Expert Moderator MVP
I'm not sure exactly where you're getting hung up, but these may help point you in the right direction (Referring to Items on a Sub-Form & Cascading Combo/List Boxes).

I wouldn't do the filtering in the SQL as you do, but if you are to, you need to get the reference correct. Remember (after reading the linked article) that a subform control is not the same as the form that it contains.
Sep 23 '09 #2
luciegiles
56 New Member
Thanks NeoPa - I just needed help with the syntax and the first article you mention helped with that - it is now working.

Why not filter in the SQL? I tried working through the same problem with your Cascading Combo/List Boxes article but couldn't get it to work.
Sep 29 '09 #3
NeoPa
32,568 Recognized Expert Moderator MVP
The filter is something that needs changing most frequently. The rest of the query is the fundamental design. If you include the filtering within the query then when you need to change it you will have to revisit the whole query's SQL. Separate it out however, and you can leave the worry about the complications of the whole query to the original design. The main query can be stored simply as a QueryDef and only the Filter part need be designed directly in a string in your code.

As far as putting references within SQL to form controls goes, I try to avoid that as that makes the form being open already a dependency for the query to work. When you are building the SQL in your code there is no need to use a reference when you already have the current value available.

PS. I'm glad you managed to get that working from the linked article Lucie. Good for you.
Sep 29 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

9
6753
by: Edwinah63 | last post by:
Hi everyone, Please let there be someone out there who can help. I have two BOUND combo boxes on a continuous form, the second being dependent on the first. I have no problem getting the second combo to change depending on what values the user selects in the first box, it's just that every time the user changes the first combobox, the second combobox FOR EVERY RECORD goes blank.
4
64589
Rabbit
by: Rabbit | last post by:
Cascading Combo/List Boxes This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one determines the available options in the other. TERMINOLOGY Row Source: The table/query from which the Combo Box or List Box gets its values. Note: There are other types of row sources that can be used but for simplicity we will stick with Tables...
2
2280
by: SPOILED36 | last post by:
I am building a database to track attendance. I have one main form with multiple subforms. Within one of the subforms name sfrDailyAttendance, I also have cascading combo boxes (cboCategory and cboException) to filter difference absences (ie.Regular, Overtime, etc). cboCategory is filtered as follows: !!... Because I have the subform set up as a continuous form, I needed to add a text box (txtException) on top of one of the combo boxes...
3
3693
by: buddyr | last post by:
Hello, Yesterday I recieved help with two cascading combo boxes on an access form. I went the link http://www.fontstuff.com/access/acctut10.htm And basically used their first example. Now I may need 3 cascading combo boxes and I cannot figure out how to do that. Can you help? Thank you
7
2539
kcdoell
by: kcdoell | last post by:
I have three tables: One for the Division location: tblDivision DivisionID = Autonumber DivisionName = Text One for the Working Region: tblWrkRegion
4
3483
klarae99
by: klarae99 | last post by:
Hello, I am working on an Access 2003 Database. The tables that pertain to this issue are tblOrg, tblState, tblCity, and tblZip. I have posted the table structure with only the pertinant fields below. tblOrg OrgID, AutoNumber, PK ZipID, Number, FK tblState StateID, AutoNumber, PK
1
2667
kcdoell
by: kcdoell | last post by:
Good Morning: I have a form where I am trying to create cascading combo boxes. I have done this before but I am getting the following error that is throwing me off: Procedure declaration does not match description of event or procedure having the same name. Basically have three tables: One for the Division location:
3
3975
kcdoell
by: kcdoell | last post by:
I have 5 cascading combo boxes on a form. Below is a sample of my vb in the first combo box: Private Sub CboDivision_AfterUpdate() 'When the Division is selected, the appropriate Segment list will 'display in the drop down list of CboSegment With Me! If IsNull(Me!cboDivision) Then
7
5827
by: Toireasa | last post by:
Hi, Newbie Access developer here, and my first post on this forum, so I might not get everything right - thanks in advance for your help and your patience! I'm using Access 2007, in XP. I'm currently trying to set up a whole pile of cascading combo boxes of different levels of complexity, so I started with the easiest set - and can't even get that to work (even using the tutorial on this site at...
0
8435
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8547
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7368
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5655
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4181
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1754
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.