Re: Access module does not continue past the Filter Method
- From: "Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx>
- Date: Wed, 22 Mar 2006 07:46:27 +0800
What setting do you have under:
Tools | Options | General | Error Trapping
(from the code window)?
How is this procedure being called? Is it called from another procedure that
has error trapping enabled? If so, comment out the On Error Goto in the
upper level procedure(s).
If that still fails, it might be time to copy all the code out of the module
to a text file. Then delete the module (or, if it is the module of a form,
set the form's HasModule property to No.) Compact the database. Create a new
module (or open the code window from the form). Paste the text back in.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"dalbin" <dalbin@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:356D82ED-F6C9-43FF-8E21-51873BD368BD@xxxxxxxxxxxxxxxx
I figured out the "AllowBreakIntoCode" Problem. AllowBreakIntoCode is set
to
"True". But, I still receive no messages from access. Why?
"dalbin" wrote:
I have begun to consider whether AllowBreakIntoCode is enabled, but I am
having trouble accessing it. The program that I wrote is:
Sub SetStartupProperties()
Dim dbs As DAO.Database
Dim prpNew As DAO.Property
Set dbs = CurrentDb
Set prpNew = dbs.CreateProperty("AllowBreakIntoCode", dbBoolean,
True)
Debug.Print "Before the Append Statement"
dbs.Properties.Append prpNew
Debug.Print "After the Append Statement"
End Sub
The program makes it to "Before the Append Statement", but does not make
it
to the "After the Append Statement".
I have another program that loops through all of the properties, printing
them to the debug window. "AllowBreakIntoCode" is not one of the
properties.
Any ideas?
"dalbin" wrote:
I have added a Debug.Print to the top of the routine and it does
execute.
I successfully put a breakpoint on the top Debug.Print line, but when I
run
the program it does not suspend execution at the breakpoint. It
proceeds
right past the breakpoint, as if it were not there.
One thing I did notice: After I click the "Reset" Button (that looks
like a
stop button), the subroutine executes perfectly. I take this to mean
that
something needs to be reset. But, the "Reset" Button seems to reset
global
variables, which I do need. So, that is not really an option.
Thanks again for your help.
"Allen Browne" wrote:
Add a Debug.Print to the top of the routine to ensure that is in fact
executing.
Then put a break point on the top Debug.Print line (by pressing F9.)
When it
breaks, press F8 to single-step through the code, so you can see
where it is
going.
"dalbin" <dalbin@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:43774251-A5D1-4C3E-82DA-DAF3B171C957@xxxxxxxxxxxxxxxx
Allen,
Thank you for your reply. I tried both of your suggestions, but
neither
fixed my problem. I did verify that the "decompile" switch did
decompile
my
program. I also added the "Dirty" code, but this problem appears
even
when
the record is not "Dirty".
Nonetheless, I had not thought of either of your suggestions, and I
appreciate your help. Please let me know if you have any other
suggestions.
"Allen Browne" wrote:
Decompile a copy of the database by entering something like this
at the
command prompt while Access is not running. It is all one line,
and
include
the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe"
/decompile
"c:\MyPath\MyDatabase.mdb"
Then compact the database.
You have not actully set the FilterOn property. Additionally, it
may not
work as expected if the form is dirty with a record that cannot be
saved
(e.g. required field missing, or validation rule not met.)
Try something like this:
Public Sub Apply_Tech_Filter()
With Forms![Technical Form]
If .Dirty Then .Dirty = False
.Filter = "RequestType = 1"
.FilterOn = True
End With
Debug.Print "Past the Filter"
End Sub
(We are assuming that RequestType is a Number type field.)
"dalbin" <dalbin@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F32C47F1-345F-4613-A0EE-14BB5F4AB570@xxxxxxxxxxxxxxxx
I have a subroutine in an Access Module that creates and applies
a
filter.
When I call the subroutine, it does apply the filter, giving no
error
messages. But, the program stops after the filter is applied.
It does
not
continue to process subsequent commands. Please provide any
insight
into
why
this is happening.
The code is:
Public Sub Apply_Tech_Filter()
Dim RequestType As Integer
Request_Type = 1
Forms![Technical Form].Filter = "RequestType = " & Request_Type
Debug.Print "Past the Filter"
End Sub
PROBLEM: It does not proceed to the "Debug.Print" Line.
NOTE: RequestType is a field on the "Technical Form" Form.
.
- Follow-Ups:
- References:
- Re: Access module does not continue past the Filter Method
- From: Allen Browne
- Re: Access module does not continue past the Filter Method
- From: dalbin
- Re: Access module does not continue past the Filter Method
- From: Allen Browne
- Re: Access module does not continue past the Filter Method
- From: dalbin
- Re: Access module does not continue past the Filter Method
- From: dalbin
- Re: Access module does not continue past the Filter Method
- From: dalbin
- Re: Access module does not continue past the Filter Method
- Prev by Date: Re: WHAT IS A MODULE? WHEN SHOULD I USE IT?
- Next by Date: Re: Get Data Type
- Previous by thread: Re: Access module does not continue past the Filter Method
- Next by thread: Re: Access module does not continue past the Filter Method
- Index(es):
Loading