473,385 Members | 1,359 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,385 software developers and data experts.

Opening a filtered form from a custom switchboard

55
Hi - In Access 2000, I'm trying to create a switchboard so users can open a certain form with different filters. I thought I would use an option group with toggle buttons. I suppose it could be just a series of command buttons instead. Either way, I can't figure out the code to get Access to both open a form and filter it at the same time.

Part of my trouble is also that the terms I need to filter on are multiple words, and I'm really confused about how to correctly refer to things with multiple words that are separated by spaces when I'm working in VB -- when to use [], or _, or " ", etc.

The form is called BID LIST.
The filter is on a control called Status2. The options are:
1. Bid Accepted
2. Submitted Budgetary Bid
3. No Bid
4. Bid Rejected
5. Bid in Process
6. Bid Submitted
7. ...and of course, 'no filter' is another option. (In other words, just open the form).

I tried making just one command button to open the "Bid Submitted" version of the form. Using the command button wizard, I first created the button to open the BID LIST form. This is the code I got:
Private Sub Command13_Click()
On Error GoTo Err_Command13_Click
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "BID LIST"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command13_Click:
Exit Sub
Err_Command13_Click:
MsgBox Err.Description
Resume Exit_Command13_Click
End Sub
Then I had the code I've used in the past to create filtering option buttons within a form:
BID_List.Filter = "Status2 = Bid Submitted"
BID_List.FilterOn = True
Of course, I don't know how to deal with the two words Bid Submitted that are already within a quotation-marked statement... ??

And I couldn't figure out where to insert these two lines in the larger mess of code for opening the form. I tried:
Private Sub Command13_Click()
On Error GoTo Err_Command13_Click
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "BID LIST"
DoCmd.OpenForm stDocName, , , stLinkCriteria

BID_List.Filter = "Status2 = [Bid Submitted]"
BID_List.FilterOn = True
Exit_Command13_Click:
Exit Sub
Err_Command13_Click:
MsgBox Err.Description
Resume Exit_Command13_Click
End Sub
...but I got an error message when I tried out the button ("Object Required"). I have no idea whether the error has to do with the wording, placement, or punctuation of the code I inserted.

Any ideas?

Angi
Feb 11 '08 #1
9 2307
ADezii
8,834 Expert 8TB
Hi - In Access 2000, I'm trying to create a switchboard so users can open a certain form with different filters. I thought I would use an option group with toggle buttons. I suppose it could be just a series of command buttons instead. Either way, I can't figure out the code to get Access to both open a form and filter it at the same time.

Part of my trouble is also that the terms I need to filter on are multiple words, and I'm really confused about how to correctly refer to things with multiple words that are separated by spaces when I'm working in VB -- when to use [], or _, or " ", etc.

The form is called BID LIST.
The filter is on a control called Status2. The options are:
1. Bid Accepted
2. Submitted Budgetary Bid
3. No Bid
4. Bid Rejected
5. Bid in Process
6. Bid Submitted
7. ...and of course, 'no filter' is another option. (In other words, just open the form).

I tried making just one command button to open the "Bid Submitted" version of the form. Using the command button wizard, I first created the button to open the BID LIST form. This is the code I got:
Private Sub Command13_Click()
On Error GoTo Err_Command13_Click
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "BID LIST"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command13_Click:
Exit Sub
Err_Command13_Click:
MsgBox Err.Description
Resume Exit_Command13_Click
End Sub
Then I had the code I've used in the past to create filtering option buttons within a form:
BID_List.Filter = "Status2 = Bid Submitted"
BID_List.FilterOn = True
Of course, I don't know how to deal with the two words Bid Submitted that are already within a quotation-marked statement... ??

And I couldn't figure out where to insert these two lines in the larger mess of code for opening the form. I tried:
Private Sub Command13_Click()
On Error GoTo Err_Command13_Click
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "BID LIST"
DoCmd.OpenForm stDocName, , , stLinkCriteria

BID_List.Filter = "Status2 = [Bid Submitted]"
BID_List.FilterOn = True
Exit_Command13_Click:
Exit Sub
Err_Command13_Click:
MsgBox Err.Description
Resume Exit_Command13_Click
End Sub
...but I got an error message when I tried out the button ("Object Required"). I have no idea whether the error has to do with the wording, placement, or punctuation of the code I inserted.

Any ideas?

Angi
Expand|Select|Wrap|Line Numbers
  1. BID_List.Filter = "[Status2] = 'Bid Submitted'"
  2. BID_List.FilterOn = True
Feb 12 '08 #2
angi35
55
Expand|Select|Wrap|Line Numbers
  1. BID_List.Filter = "[Status2] = 'Bid Submitted'"
  2. BID_List.FilterOn = True

Thanks, but I'm still having the error problem. My form is called BID LIST, but I noticed that when I type BID_LIST.Filter, the program insists on automatically changing LIST to List. Maybe this is the problem. Is there any way to make it stop changing this?

Angi
Feb 12 '08 #3
ADezii
8,834 Expert 8TB
Thanks, but I'm still having the error problem. My form is called BID LIST, but I noticed that when I type BID_LIST.Filter, the program insists on automatically changing LIST to List. Maybe this is the problem. Is there any way to make it stop changing this?

Angi
I'll try to duplicate the problem and get back to you.
Feb 12 '08 #4
ADezii
8,834 Expert 8TB
Thanks, but I'm still having the error problem. My form is called BID LIST, but I noticed that when I type BID_LIST.Filter, the program insists on automatically changing LIST to List. Maybe this is the problem. Is there any way to make it stop changing this?

Angi
Expand|Select|Wrap|Line Numbers
  1. If your Form is called BID LIST, then:
  2. Forms![BID List].Filter = "[Status2] = 'Bid Submitted'"
  3. Forms![BID List].FilterOn = True
  4.              OR
  5. Me.Filter = "[Status2] = 'Bid Submitted'"
  6. Me.FilterOn = True
Feb 12 '08 #5
angi35
55
Expand|Select|Wrap|Line Numbers
  1. If your Form is called BID LIST, then:
  2. Forms![BID List].Filter = "[Status2] = 'Bid Submitted'"
  3. Forms![BID List].FilterOn = True
  4.              OR
  5. Me.Filter = "[Status2] = 'Bid Submitted'"
  6. Me.FilterOn = True

Thanks for your help! That did it.

Patty
Feb 12 '08 #6
ADezii
8,834 Expert 8TB
Thanks for your help! That did it.

Patty
You're welcome, Patty.
Feb 12 '08 #7
mshmyob
904 Expert 512MB
From Angi to Patty - neat trick (lol)
You're welcome, Patty.
Feb 12 '08 #8
ADezii
8,834 Expert 8TB
From Angi to Patty - neat trick (lol)
After almost 3,000 Posts, the names sort of all blend in together. (LOL).
Feb 12 '08 #9
angi35
55
After almost 3,000 Posts, the names sort of all blend in together. (LOL).
Oh well... I'll answer to both.

Angi, aka Patty
Feb 13 '08 #10

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

Similar topics

4
by: MVM | last post by:
Hi everyone, I am working on an Access project (ADP). I have a switchboard form setup to allow the user to open up another form by entering search criteria in a text box and clicking a command...
3
by: Craig Brown | last post by:
I would like to open selected (Filtered) records in a form. I currnetly have a custom menu but would like to only open certain records from i.e Button 1 will open Site 1 Button 2 will open...
13
by: Martin Dennett | last post by:
Hi I'm new to this group so go easy on me! I currently use a database that has had one constant niggle for a while and I was wondering if anybody can help sort it out. From an opening screen...
1
by: Don Sealer | last post by:
I have a report that includes 5 different subreports. I'd like to be able to open this report using a date function (Start Date and End Date). I'd like all five subreports to show the data from...
0
by: Don Sealer | last post by:
I have a report that includes 5 different subreports. I'd like to be able to open this report using a date function (Start Date and End Date). I'd like all five subreports to show the data from...
5
by: Andy P via AccessMonster.com | last post by:
I am responsible for maintaining our departmental intranet pages at work. I would like to put a link from our website to a MS Access database which is held on our Network drive. The problem I...
8
by: Emily Jones | last post by:
Very strange one this. Application written in Access 2000. Runs in 2003 at client's site, 2000 on my development system. FE/BE system. The app's startup form sets a few options, opens the...
4
by: Scott.McCoid | last post by:
I'm sure this is an easy one that I can't solve, but I want an action in one form to reset my TimerInterval on my switchboard (a separate form). I tried the code below without success. Any...
2
by: TADEL714 | last post by:
I am trying to open a form based on the record set of the current form. The form I am opening should filtered based on a text field and a date field. The code I am using is as follows: Private Sub...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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...

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.