473,695 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Specific Form Filtering Techniques

Okay, I have worked on this and then some, but cannot seem to crack
it. So if someone can straighten my code out, or suggest a new
approach, then I'm all ears.

Here goes: I have two tables - one (tblReports) with all of the fields
appearing on a report selection form (frmReports). The other one
(tblGroup) is only use for the eight group types that I'm trying to
use as a filter. The tblGroup is hooked to the tblReports Group field
(rptType). When I open the combo box (cboEight) on the form, I see the
8 groups listed, and also in the list box (lboList), I see "all
groups" of the reports listed (rptName).

Now, what I want to do is simply have a little code on the OnOpen
event of the report selection form that enables the filter (if used -
no filtering if not) to only show the related reports under the
selected group. So far - no go. Here is one piece of code that I used,
but it triggered Error 2448 - can't assign a value to this object. Of
course, I got a couple of different errors after tweaking it. The
code: Me.Filter = "rptType = " & Form_frmReports .cboEight.Value
Me.FilterOn = True
I also used rptName in lieu of rptType - same error message. What do
you think?

Thanks in advance for showing me "where" I missed it. Dalan
Nov 12 '05 #1
2 3641
Dalan,

After the form is open, when the user chooses a group from the combo
box cboEight, dynamically change the RecordSource property for the
form to an sql statement that will select only reports for the group
chosen. Do this in the On Click event for the combo box.

Code Sample:

Private Sub cboEight_Click( )

If Not IsNull(Me.cboEi ght) Then
Me.RecordSource = "SELECT * FROM tblReports WHERE [rptType] =
'" & Me.cboEight & "'"
End If

End Sub

Changing the RecordSource property will cause the recordset underlying
the form to be requeried automatically. I hope I understood your
question correctly and I hope my response helps.

Mike Pace
M. L. Pace Computer Consulting
Mobile, Alabama

ot***@safe-mail.net (Dalan) wrote in message news:<50******* *************** ****@posting.go ogle.com>...
Okay, I have worked on this and then some, but cannot seem to crack
it. So if someone can straighten my code out, or suggest a new
approach, then I'm all ears.

Here goes: I have two tables - one (tblReports) with all of the fields
appearing on a report selection form (frmReports). The other one
(tblGroup) is only use for the eight group types that I'm trying to
use as a filter. The tblGroup is hooked to the tblReports Group field
(rptType). When I open the combo box (cboEight) on the form, I see the
8 groups listed, and also in the list box (lboList), I see "all
groups" of the reports listed (rptName).

Now, what I want to do is simply have a little code on the OnOpen
event of the report selection form that enables the filter (if used -
no filtering if not) to only show the related reports under the
selected group. So far - no go. Here is one piece of code that I used,
but it triggered Error 2448 - can't assign a value to this object. Of
course, I got a couple of different errors after tweaking it. The
code: Me.Filter = "rptType = " & Form_frmReports .cboEight.Value
Me.FilterOn = True
I also used rptName in lieu of rptType - same error message. What do
you think?

Thanks in advance for showing me "where" I missed it. Dalan

Nov 12 '05 #2

Use the Load event instead of Open

Good luck,

Dan

Originally posted by Dalan
Okay, I have worked on this and then some, but cannot seem to crack it. So if someone can straighten my code out, or suggest a new approach, then I'm all ears. Here goes: I have two tables - one (tblReports) with all of the fields appearing on a report selection form (frmReports). The other one (tblGroup) is only use for the eight group types that I'm trying to use as a filter. The tblGroup is hooked to the tblReports Group field (rptType). When I open the combo box (cboEight) on the form, I see the 8 groups listed, and also in the list box (lboList), I see "all groups" of the reports listed (rptName). Now, what I want to do is simply have a little code on the OnOpen event of the report selection form that enables the filter (if used - no filtering if not) to only show the related reports under the selected group. So far - no go. Here is one piece of code that I used, but it triggered Error 2448 - can't assign a value to this object. Of course, I got a couple of different errors after tweaking it. The code: Me.Filter = "rptType = " & Form_frmReports .cboEight.Value Me.FilterOn = True I also used rptName in lieu of rptType - same error message. What do you think?


Thanks in advance for showing me "where" I missed it. Dalan

--
Posted via http://dbforums.com
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
7846
by: Robert Neville | last post by:
I would like to add filter functionality to my database whether through the Main form or the subform. This question may be rudimentary, yet I have not less experience with filtering data outside from queries. Let me just add that Allen Browne excellent article about this subject may not apply to this scenario on an elementary level. (Here's the link to the article; Filter a Form on a Field in a Subform -...
0
6472
by: CSDunn | last post by:
Hello, I have a problem with field filtering between an Access 2000 Project form (the application is called CELDT), and the report that shows the results of the filter. Both the form and the report are based on the same View addressed in the Record Source of both as 'dbo.CLMain_vw'. The View resides in a SQL Server 2000 database. There are two different problems I am having with filtering: The first involves filtering in the form by date...
0
1609
by: Keith Shearer | last post by:
I'm having a bit of trouble, moving between controls, when filtering on a form. I'm using a continuous form. At the top I have 2 date fields. I want to filter the data specified between the two date fields ... The problem is ... I'm doing my filtering on the afterupdate event. So I type in a date and press TAB. The filter works and automatically refreshes the form, then the cursor does not move on to the next control, but comes back to...
5
3083
by: Richard | last post by:
Hi, I have a form that take some time to load due to many comboboxes and at least 8 subforms. When I filter or sort the main form I get an error message and then Access shuts down. They ask if I want to send the error report to Microsoft. Has anybody seen this type of error message and what can I do to prevent it from happening. Am I doing something illegal in my code? It used to work but I have added conditional formatting to a subform...
3
3844
by: Cagey | last post by:
What I'm trying for: If this selection or if click on selection (highlighted line choice/ which ever selection change) w/in query's combo dropdown list box (on Switchboard), then Open in Datasheet View, the specific underlying record's Row... showing all columns Or selected columns. For a specific row's record ONLY, Or for all Xs (same type), or for the whole data sheet (all records... includes all types then), but focus still opens...
7
6739
by: Katherine | last post by:
I'm trying to filter the records on the mainform (MailingList) of my database using a field contained in a subform (Donations). I was basing my code off Allen Browne's Access Tips page (here: http://allenbrowne.com/ser-28.html) since it has worked so well in the past. However, now I'm trying to filter by date instead of by a string or a number, and I'm getting nowhere. My goal is to have users type a date into the unbound combo box and...
0
3124
by: Yarik | last post by:
Hello, Here is a sample (and very simple) code that binds an Access 2003 form to a fabricated ADO recordset: ' Create recordset... Dim rs As ADODB.Recordset: Set rs = New ADODB.Recordset ' Append one or more fields... Call rs.Fields.Append("Number", adInteger)
0
2002
by: Lyn | last post by:
I have a problem using the form .Filter and .FilterOn properties which causes Access to crash (as detailed in a separate post). The form operates in continuous mode, displaying matching records from a file based on a search criterion. This basic functionality works just fine. I decided to allow the user to narrow down the output by providing some extra controls to allow the user to filter the recordset via the .Filter form property. ...
4
9494
by: dizzydangler | last post by:
Hi all, I am a new Access user and just starting to get my head around some of the basic concepts, so please take it easy on me :) My company has been managing client records on excel, and I’m in the process of migrating the data over to Access 2007 (Windows XP), kind of learning as I go. I’ve managed to import the client records into a single table, and set up a “single view” form that streamlines how we input new client data. Now I’m...
1
8867
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
8841
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
7688
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
6511
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
5847
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
4351
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
3025
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
2291
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1987
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.