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

Trying to set form filter from module

Hello there!

I have a piece of code in a module (function) that constructs a
filter.
But now I run into a problem.....

It seems that I can only set a filter form a module if I open the form
in design mode..............
(that is, if changing the filter from a module / called function)
But that means any other changes I made on the form (such as f..e. the
rowsource of several comboboxes) will be
undone........................
Is my conclusion right?

TIA Henro

Mar 8 '07 #1
2 5887
Henrootje wrote:
Hello there!

I have a piece of code in a module (function) that constructs a
filter.
But now I run into a problem.....

It seems that I can only set a filter form a module if I open the form
in design mode..............
(that is, if changing the filter from a module / called function)
But that means any other changes I made on the form (such as f..e. the
rowsource of several comboboxes) will be
undone........................
Is my conclusion right?

TIA Henro
Me.Filter = "ID = 1"
Me.FilterOn = True

If referring from elsewhere
Forms!Form1.Form.Filter = "ID = 1"
Forms!Form1.Form.FilterOn = True

Or
strFilter = "Select * From Table1 Where ID = 1"
Me.Recorsource = strSQL

Mar 8 '07 #2
On 8 mrt, 17:09, salad <o...@vinegar.comwrote:
Henrootje wrote:
Hello there!
I have a piece of code in a module (function) that constructs a
filter.
But now I run into a problem.....
It seems that I can only set a filter form a module if I open the form
in design mode..............
(that is, if changing the filter from a module / called function)
But that means any other changes I made on the form (such as f..e. the
rowsource of several comboboxes) will be
undone........................
Is my conclusion right?
The referring from elsewhere just did not want to work. But I put the
code in a sub on the foprm itseld and now call that sub whenever
needed. Works like a charm!
>
Me.Filter = "ID = 1"
Me.FilterOn = True

If referring from elsewhere
Forms!Form1.Form.Filter = "ID = 1"
Forms!Form1.Form.FilterOn = True

Or
strFilter = "Select * From Table1 Where ID = 1"
Me.Recorsource = strSQL- Tekst uit oorspronkelijk bericht niet weergeven -

- Tekst uit oorspronkelijk bericht weergeven -

Mar 9 '07 #3

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

Similar topics

2
by: Bob Quintal | last post by:
Using Access 97, with the runtime parameter. I have a an application that needs a filter by form replacement, because that is unimplemented in runtime mode. I call the filter parameters form...
1
by: Jason | last post by:
I have succussfully ran the code below from a module. The code runs SQL update statements from a memo field in a table, called tblSQL. The field ! (Line 11) allows you to filter out the records in...
0
bartonc
by: bartonc | last post by:
By encapsulating just a few fuctions from two library modules, we get a clear picture of what a digital filter looks like. Also, by splitting __init__ into two section, the filter's creation...
2
NeoPa
by: NeoPa | last post by:
CHAPTER 1 - TABLE OF CONTENTS (Including attached database) CHAPTER 2 - INTRODUCTION CHAPTER 3 - TABLE LAYOUT CHAPTER 4 - FORM LAYOUT CHAPTER 5 - FORM MODULE CHAPTER 6 - CODE DISCUSSION (FILTER...
3
by: Henrootje | last post by:
I have a form based on the query: SELECT tblCreditGeld.CG_Selected, tblCreditGeld.CG_ClientSelected, tblCreditGeld.CG_ComplexSelected, tblCreditGeld.CG_OKGR_ID, tblCreditGeld.CG_OKGR_IDN,...
0
by: Henrootje | last post by:
Hello there! I have a piece of code in a module (function) that constructs a filter. But now I run into a problem..... It seems that I can only set a filter form a module if I open the form...
2
by: Josh Naro | last post by:
I am writing a module that requires the entire output from a web app to perform its function. So, basically I need to be able to pull the entire output stream from the Response object. I've tried...
17
by: DeZZar | last post by:
Hi all, I need to regularly backup my database as an Excel file and have been using the File Export option. Problem is I need anyone using the database to be able to do this easily - nopt...
9
by: sparks | last post by:
Right now I had to build a report that allowed the people to check for gross outliers in their data input. short I am looking at 2.5* std dev + - anyway I used 2 dummy variables in the query the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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: 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
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...

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.