473,793 Members | 2,927 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access 07 ComboBox Filter results category subcategory type SubType

gcoaster
117 New Member
Hello Everyone!

I have a question regarding "cascading combobox(s) list(s)"

I would like:

ComboBox 2 to show results from ComboBox 1's selection,
then ComboBox 4 to show results from ComboBox 3's choice

For Instance these are the combo boxes
[category] [subcategory] [type] [subtype]

This is the sample of choices in the combo boxes
HARDWARE - CABLES - USB - 2.0
HARDWARE - CPU - AMD - AM2

QUESTION(s)

Do I create ONE table for this? OR
Do I create 4 tables = tblcategory tblsubcategory tbltype tblsubtype ?
Do I place a QUERY in the middle of the TABLE(s) and the FORM?

Should I use VBA to make this work?
Should I use sql in the control source to make this work?

What is the best solution? so many answers, so many posts,..
a lookup in a table field.

thank you in advanced!!!

Matt
Oct 4 '07
34 12607
gcoaster
117 New Member
Hi, Matt.

See the attached example.
Thank you FishVal

the database you uploaded, DOES NOT have any vba..
After update just has a =RequireDescCom bo(2) are you recommending not using a module?

and if this is in a form.. can the Control Source be appended to a column in a table?
Oct 7 '07 #21
gcoaster
117 New Member
Hello NeoPa,
ROW SOURCE = "nothing"


If you examine the .RowSource property after it's been set up - you'll easily see what I mean ;)
Oct 7 '07 #22
gcoaster
117 New Member
FishVal, NeoPa..

I got it to work, HOW EVER..

when the data is selected and posted to control source/table

Numbers are entered, instead of text!

LEVEL1 LEVE2 LEVEL3 LEVEL4
1 2 3 4

How do I get it to show, or post as, or enter as text?

LEVEL1 LEVE2 LEVEL3 LEVEL4
Software Micro$0ft Access 2003 PAIN IN THE

ALMOST!
Oct 7 '07 #23
NeoPa
32,579 Recognized Expert Moderator MVP
Hello NeoPa,
ROW SOURCE = "nothing"
Looking at your code from post #17.
Let line #6 run (so Me!cmboCategory NOT null) then look at the contents of the .RowSource control.
Oct 7 '07 #24
gcoaster
117 New Member
Looking at your code from post #17.
Let line #6 run (so Me!cmboCategory NOT null) then look at the contents of the .RowSource control.
So Line 6
Expand|Select|Wrap|Line Numbers
  1.    .RowSource = "SELECT MaincategoryID, name" & _
Should Now Be
Expand|Select|Wrap|Line Numbers
  1.            .RowSource = "SELECT MaincategoryID, name" & _ so Me!cmboCategory NOT null
  2.  
?!?!?
Oct 7 '07 #25
NeoPa
32,579 Recognized Expert Moderator MVP
So Line 6
Expand|Select|Wrap|Line Numbers
  1. .RowSource = "SELECT MaincategoryID, name" & _
Should Now Be
Expand|Select|Wrap|Line Numbers
  1. .RowSource = "SELECT MaincategoryID, name" & _ so Me!cmboCategory NOT null
?!?!?
No. Not at all.
Add the following line into your code after line #8 (Lines #6 to #8 are actually all the same line in VBA)
Expand|Select|Wrap|Line Numbers
  1. Call MsgBox(.RowSource)
Then look at the SQL as it's shown to see clearly why your code is not quite right (Again Let line #6 run (so Me!cmboCategory NOT null)).
Oct 7 '07 #26
gcoaster
117 New Member
NeoPa, I am Almost there.

All I need now is to figure out how to get DLookUp to write to a field!
Expand|Select|Wrap|Line Numbers
  1. =DLookUp("[model]","qPRODrest")
  2. =DLookUp("[make]","qPRODrest")
  3. =DLookUp("[description]","qPRODrest")
  4. =DLookUp("[UnitPrice]","qPRODrest")
  5. =DLookUp("[purchasedPrice]","qPRODrest")
Last Step I used DLookUp to bring the data in to last leftover fields from cascade comboboxes...

I ended up using one table and 4 querys.
A little VBA as well!
Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo0_AfterUpdate()
  2. Me!Combo1.Requery
  3. End Sub
  4.  
  5. Private Sub Combo1_AfterUpdate()
  6. Me!Combo2.Requery
  7. End Sub
each combobox, category/subCategory/type.. used each query!
the query's filter each other
for instance, in the subcategory query

Category | PRODUCT | Groupby |
[Forms]![INVOICE]![INVOICEsubform]![ComboCategory]

The Last query pulls in the rest and populates the left over fields, Text Boxes bound to table fields in details table..

the values are there! its working! but the values are NOT writing to the text box's!!! to the table columns!!!

I realized it when I couldn't get the grandtotal to add up! oh man! I have been working 1 week on this, micro$oft is killing me.

one last step and I am stuck!!! ahahaha i HATE ACCESS!! LOL
Attached Images
 
Attached Images
File Type: jpg screenShot.jpg (22.3 KB, 479 views)
File Type: jpg form.jpg (8.3 KB, 252 views)
Oct 8 '07 #27
NeoPa
32,579 Recognized Expert Moderator MVP
Please check out post #19 where it talks about using [ CODE ] tags in your posts. I've had to edit your post again and frankly I'm getting tired with tidying up after you.

Also, if you'd like me to continue working with me I'd appreciate feedback related to my posts. Explaining where you are from scratch (as you seem to have in your last post) is frustratingly difficult to follow.

How would you communicate with someone when they appear to ignore everything you try to tell them and just go on their own merry way regardless. It's not good manners and it's very difficult for me to be of any use to you.

I still don't know if you've understood my first point yet and, regardless of whether you work by jumping around from issue to issue, I know better, so don't expect me to follow you.
Oct 8 '07 #28
gcoaster
117 New Member
Expand|Select|Wrap|Line Numbers
  1. Ok, I am with you. I will start using the code tag with the editor
Oct 8 '07 #29
gcoaster
117 New Member
OK! I think I got it! (including putting the code in the code tags for neopa) I think I got comboboxes to filter using querys to last combobox then last combobox populates the remaining columns in table!
you have taught me well FishVal.

this solution uses hardly ANY vba and writes TEXT to record instead of ID number.

The fallowing comboboxes are cascading comboboxes and filter to comboprodname. using 5 querys.

Expand|Select|Wrap|Line Numbers
  1. Combocategory
  2. Combosubcategory
  3. Combotype
  4. comboboxsubtype
  5. Comboprodname
When item is selected in comboprodname combobox..
Then the remaining fields in table (which are each bound in control source)
are populated VIA vba!

The remaining text box fields on form are

Expand|Select|Wrap|Line Numbers
  1. Description
  2. Make
  3. Model
  4. UnitPrice
  5. purchasedPrice
So VBA in afterupdate in Comboprodnamewh ich is the
LAST combobox should look something like this?

Expand|Select|Wrap|Line Numbers
  1. Private Sub productName_AfterUpdate()
  2. Me.description = DLookup("[description]", "qPRODrest")
  3. Me.make = DLookup("[make]", "qPRODrest")
  4. Me.model = DLookup("[model]", "qPRODrest")
  5. Me.UnitPrice = DLookup("[UnitPrice]", "qPRODrest")
  6. Me.purchasedPrice = DLookup("[purchasedPrice]", "qPRODrest")
  7. End Sub
wait, something is out of the ordinary.. it works!

I will post the entire project and code with comprehensible images when I am done with this here if I can and on my website,

Freely ye have received, freely give. Matt 10:8

thank you FishVal!

And NeoPa.

Matt
Oct 8 '07 #30

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

Similar topics

5
3385
by: Travis Pupkin | last post by:
Hey, I've done a number of product catalogs/galleries with one or two category levels (Category > Subcategory). The straightforward way to do this, of course, is to use database fields for Category and Subcategory and query off of those fields. I have a client now who is interested in what sounds to me to be an unnecessarily complex catalog with an as of yet undefined number of category levels at their disposal.
3
4618
by: Rich Protzel | last post by:
Hello, So my table contains say 100,000 records, and I need to group the categories in fld1 by the highest count of subcategories. Say fld1 contains categories A, B, C, D, E. All of these categories contain subcategories AA, AB, AC, AD,...AJ, BA, BB...BJ, CA, CB, CC...CJ, etc in fld2. I am counting how many subcategories are listed for each category. Like
1
306
by: A.J.M. van Rijthoven | last post by:
I have a form with data from a box (Table box), on his form is a subform with the instuments that are in this box. The instruments (Table instruments) are categorized by category (Table Category). This is done because there are a verry much different instruments to choose from. Now I want to choose a category so that the active record in the subtable (combobox) shows only the instruments that belong to the selected category. This works...
9
4325
by: Neil Ginsberg | last post by:
I have a strange situation using Access to automate a Word mail merge. Using Access 2000 and Word 2000, the code opens Word, opens the document in Word, sets a table in the calling Access application as the data source, and then performs a merge. Everything works fine. However, when a user uses it in Access 2002 and Word 2002, an extra instance of the Access application is opened and remains open at the end. Sometimes it remains open
0
982
by: Ron | last post by:
I am trying to create a nested DataList with multiple subcategories listed under each primary category. Unfortunately, I end up with a bunch of multiple SubCategory values after iterating through the loop. My code is as follows: //**************************************************************** for(int i=0;i<=cat.Count-1;i++) {
1
1498
by: bobika | last post by:
Hi Im am implementing a small database system using MS Access. I have two main fields: :product category and product type! Product category contains ABC and XYZ categories. I added both in the combobox selection just fine. In category ABC it contains several product types say NB and DT In cateogfry XYZ it contains different product types say HTand HP. I made both fields (product type and category) comboboxes. my problem is that when the...
1
2801
by: Webstorm | last post by:
Hi, I hope someone can help me sort this out a bit, Im completely lost. Here is the page I am working on: http://www.knzbusinessbrokers.com/default.asp I have 3 search critera that I need to use when querying the database. Right now it is only looking for a match on one of those dropdowns and not all 3. can anyone help? Here is the code: <form BOTID="0" METHOD="POST" action="businessforsale_interface/Results/test3.asp">
1
2362
by: Brit | last post by:
I have an ASP file that retrieves names from an Access database for 4 different categories of membership, which the visitor to the page selects (corporate, institutional, regular, or student). The DNS name is "cati", the names are specified in the "Last_names" field, and the categories are in the "categories" field. l want the results sorted in alphabetic order by last name. However, the results appear to be in a totally random,...
3
1415
by: jillinsky | last post by:
Wondering is this is possible - I have 2 tables. One is categories, and has catid, catname, hashighercat, and ...I can't think of the 4th one, but it isn't needed anyway. There are 40 categories, and about 1400 subcats. the categories are numbered 1-40, and the rest have their numbers - all of these are in the same field - catid. You can tell the categories from the subcategories by the field hashighercat - the 40 categories are null...
0
9518
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,...
0
10430
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10211
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10159
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
6776
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
5436
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...
1
4111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2917
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.