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

applyfilter issues.

Probablly a simple answer but I'm not sure where to begin. I have one
customer form that can be opened two ways. One of the fields in the customer
table is ActiveCustomer. If users open the form from a main menu I want the
form to open but only contain records where ActiveCustomer = Yes, i.e.

OnOpen is DoCmd.ApplyFilter , "ActiveCustomer = Yes"

If however, the user is on another form where they are viewing records
pertaining to a certain customer, there is a command button that will allow
them to open that same form and go to a specific record. This WAS done with

DoCmd.OpenForm "frmContacts", , , "ClientID = " & Me!ClientID

The problem with my method is, that the user can click on the above button
but as soon as the form is opened, it applys the filter defined in the
onopen event of the form.

How should I set up the forms so that both items work correctly?
Nov 2 '06 #1
1 1199
You can use the OpenArgs property to pass a variable to the open/load
event of the form which would specify either to use the form filter or
not. There is a real good example in the help files under openargs.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Nov 2 '06 #2

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

Similar topics

1
by: Michelle Dennard | last post by:
I am attempting to use the ApplyFilter command on a form in access and I am having some questions. Basically I have a form inwhich I select three things that constitute a key for each item. 1)...
4
by: Bob Darlington | last post by:
Can anyone tell me why: DoCmd.ApplyFilter, "ElectID = " & vNewElectID should work in an mdb, but fail when the file is converted to an mde. It fails with a 'Enter Parameter Value: ElectID"...
4
by: Colin Spalding | last post by:
How can I use the ApplyFilter method when both the control source to be filtered, and the filter are variables. I have tried the following syntax: DoCmd.ApplyFilter , "strSubject ='" & strGroup...
3
by: Robert_5032 | last post by:
I cant get my filter to work with variables Its working fine if I "hardcode" the issueType I want to filter on. Works fine: DoCmd.ApplyFilter , "issueType = 1" Works NOT: DoCmd.ApplyFilter ,...
2
by: John Smith | last post by:
The following code will not work for filtering records on a form: DoCmd.ApplyFilter , "Award =" & Not Null I use the following line to filter for a series of Yes/No boxes without trouble: ...
1
by: Jimmy Stewart | last post by:
I have a continuous form with a list of items from a table. One of the fields in the table is "print". this allows the user to select items from the list on the form for printing in a report. on...
1
by: zamir | last post by:
hi, can you applyfilter to a form based on what a user will enter in a login screen and have a specific record show up on that form. the code i already have is this: DoCmd.ApplyFilter ,...
7
by: zamir | last post by:
hi, same problem with applyfilter but i'm close. what i have done so far is a log in screen that takes a username and password and the user name is stored in a variable called StrUserName. If...
2
by: dkohel | last post by:
What is wrong with the following code? I am trying to filter a form based on the selection of a combobox named cblPRD Dim currentFilter currentFilter = " = '" & Me!cboPRD & "'" Filter =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...
0
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...
0
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...

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.