473,388 Members | 1,426 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Forms AfterUpdate

I have a form and a subform. After updating one of the cboBox in the main form [Supplier] I would like the cboBox [Products] in the subform to filter out only the products from the supplier selected above. Currently the subform picks all the products from all suppliers.
Feb 28 '08 #1
2 1266
kadghar
1,295 Expert 1GB
I have a form and a subform. After updating one of the cboBox in the main form [Supplier] I would like the cboBox [Products] in the subform to filter out only the products from the supplier selected above. Currently the subform picks all the products from all suppliers.
and your data base is in SQL? excel? access?? or is it a list you have in a combo or a listbox?
Feb 28 '08 #2
I have a similar question.
In the "Filter part" of the form, combo boxes populate the data for YearFilter and Cat(egory)Filter. The default values are preload and the filter works "On Load", but I can't get the data to refresh in the sub-form.. I also tried requery

The "AfterUpdate" of the ComboBox, I have

Private Sub cboYearFilter_AfterUpdate()
[Forms]![frmMainMenu]![txtCorpPgmYear] = cboYearFilter
Call ApplyCorpFilters
End Sub

-----------------------------
Private Sub Form_Load()
Call ApplyCorpFilters
Me.Refresh
End Sub
---------------------------------
Private Sub ApplyCorpFilters()
Me.AllowFilters = True

YearFilter = [Forms]![frmMainMenu]![txtCorpPgmYear]
CatFilter = [Forms]![frmMainMenu]![txtCorpCategoryFilter]

If CatFilter <> "(All)" Then
strFilter = "([Year] = '" & YearFilter & "' AND [Category] = '" & CatFilter & "')"
Else
strFilter = "[Year] = '" & YearFilter & "'"
End If

Me.RecordSource = "SELECT CorpPrograms.* FROM CorpPrograms WHERE " & strFilter & " ORDER BY CorpPrograms.CorpProgram"
Me.Refresh
End Sub
Apr 29 '09 #3

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

Similar topics

0
by: Doc | last post by:
Would you enter this in as an "event procedure" or right in the properties of the combo box under event / afterupdate. I kept getting an error message that it could not find the Macro "Me!", when I...
3
by: Andante.in.Blue | last post by:
Hello everyone! I'm building a form in Access 97 and I want to to show a special icon if the record has been marked as deleted. Obviously, I don't want the icon to show if the record was not...
1
by: JDKasdan | last post by:
In my current form I have a question that says "check all that apply." The list has a number of items and a "none." What do I have ot do to prevent the data entry person from checking both none...
2
by: Phil Stanton | last post by:
I have a form of club members with a continuous subform on it showing boat details. I hold the boat length and beam (in meters) in a table. On the subform I also calculate and show the imperial...
4
by: Clive | last post by:
Hi all. I'm fairly new to access (97) programming so please forgive me if this has been asked a thousand times. I have a two forms: Form A open forms B by a button/control (form B enters...
4
by: Lumpierbritches | last post by:
Thank you once again for any and all assistance. I'm building an application that's getting quite bulky due to the number of forms, macros and procedures. I was wondering if there's a way to use 1...
19
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate...
3
by: ironcito | last post by:
Hello all, I'm not an Access expert, so I'll try to explain the problem the best I can, and please try to answer so that a layman can understand it =) I have a database with several tables,...
4
by: selhamawy | last post by:
hello, I need someones expertise... i am the only part-time developer at a start up college now. question is i am using Access 2003 and creatng a form with a combination of queries,...
2
by: Joseph | last post by:
I need to create a simple for to maintain customer data. I notice that I can put on the form text boxes and point the data source to a simple database. And that works great. When I run the form,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...

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.