I need some help in finding a way to remove the filter from the
previous command.
I open the report from a form where i have option group called
Office.Depending on the option
in the option group,the record source in the report is filtered for
this option.
In the OnOpen event of the report i have :
Public town As Long
town = Forms![Form1]![Office]
In the Where part of the record source ,called Bas,( Me.RecordSource =
Bas) i have :
And ((customers.afid) = " & town & "
My code works, but only if i try again.For example,if i press the
office Number 1, then i get null.
If i press the button second time, then i get the results.If i want
then to find the results for the office Number 2, then i get the
results for the office Number 1.I have to press the button 2 seond
time, to get the right results.
Obviously i need to remofe the results in the report from the previous
command.
I tried to write the following in the OnClose event of the report :
town = ""
I got the message type mismatch
Is it possible to get the results in my report from the first time ? 2 1310
Johm wrote: I need some help in finding a way to remove the filter from the previous command. I open the report from a form where i have option group called Office.Depending on the option in the option group,the record source in the report is filtered for this option. In the OnOpen event of the report i have :
Public town As Long town = Forms![Form1]![Office]
In the Where part of the record source ,called Bas,( Me.RecordSource = Bas) i have : And ((customers.afid) = " & town & "
My code works, but only if i try again.For example,if i press the office Number 1, then i get null. If i press the button second time, then i get the results.If i want then to find the results for the office Number 2, then i get the results for the office Number 1.I have to press the button 2 seond time, to get the right results. Obviously i need to remofe the results in the report from the previous command. I tried to write the following in the OnClose event of the report : town = ""
I got the message type mismatch
Is it possible to get the results in my report from the first time ?
Can't you prompt the user for the town on the form and then pass that in
the Where string of the report.
Ex:
strTown = "Los Angelese"
Docmd.OpenForm "ABC",,,"[town]= '" & strTown & "' And Office = " & Me.Office ke**@abv.bg (Johm) wrote in
news:24*************************@posting.google.co m: I need some help in finding a way to remove the filter from the previous command. I open the report from a form where i have option group called Office.Depending on the option in the option group,the record source in the report is filtered for this option. In the OnOpen event of the report i have :
Public town As Long town = Forms![Form1]![Office]
In the Where part of the record source ,called Bas,( Me.RecordSource = Bas) i have : And ((customers.afid) = " & town & "
My code works, but only if i try again.For example,if i press the office Number 1, then i get null. If i press the button second time, then i get the results.If i want then to find the results for the office Number 2, then i get the results for the office Number 1.I have to press the button 2 seond time, to get the right results. Obviously i need to remofe the results in the report from the previous command. I tried to write the following in the OnClose event of the report : town = ""
I got the message type mismatch
Is it possible to get the results in my report from the first time ?
I don't know why you are going to open the report from the form
using code in the report instead of simply creating the where
clause in the form and passing it to the report as part of the
openreport method of docmd.
DoCmd.OpenReport reportname[,view][,filtername][,wherecondition]
--
Bob Quintal
PA is y I've altered my email address. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Mike Nau |
last post by:
I'm using command center to view my data. When I enter a query on the
interactive tab, once executed it takes me to the results tab but
doesn't display anything. If I enter the same query in the...
|
by: Mark Payne |
last post by:
Gudday,
I have an Access 2000 database which I am using as a phone directory
of residents in the hostel where I work. The front end for this
directory is a form with a text box (the search name...
|
by: Anders Borum |
last post by:
Hello!
I'm am currently working on making a central cache component threadsafe, and
was looking at the synchronized implementation of the Hashtable. I was
wondering why you'd really want to...
|
by: Haydnw |
last post by:
Hi,
I'd like to put a load of database results (several rows for 5 fields) into
a two-dimensional array. Now, this may be a really stupid question, but can
someone give me a pointer for how to...
|
by: Nathan |
last post by:
I want to delete a row from a dataset, and I use:
Dim SelectedRow() as DataRow = DataSet1.Table1.Select("Selection Criteria")
DataSet1.Table1.Rows.Remove(SelectedRow(0))
The SelectedRow...
|
by: Daniel Di Vita |
last post by:
I have created an ASP.NET page that allows the user to page through a result
set. I need to expand on this. On that same page I a filed where the user can
type in a search string. When they click...
|
by: Mark A |
last post by:
In the DB2 Admin Client (8.2.4), when the results of a query are displayed
in the grid that looks like a spreadsheet (using Command Editor or double
click on table name in Control Center). The data...
|
by: Beholder |
last post by:
I hope that someone can help me with the following:
Short background explenation:
I have a shrfepoint page (newform.aspx) in a item list. On this page is
a lookup column that displays a lookup...
|
by: =?Utf-8?B?R3JlZw==?= |
last post by:
I have the following code the dynamically adds a specific number of controls.
for x as integer = 1 to 10
Dim btn as Windows.Forms.Button = New Windows.Forms.Button
btn.Name = "btn" & x
btn.Text...
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
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...
|
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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: 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...
| |