Re: Compile error: Block If without If
- From: "BruceM" <bamoob@xxxxxxxxxxxxxxxxx>
- Date: Mon, 8 Jan 2007 12:56:16 -0500
CaseNumber, OfficerNumber, and Incident are showing up in the string. Is
that the intention? The string is looking for records with the date
11/27/2005, a zero-length string in the Incident field, and nothing at all
in CaseNumber and OfficerNumber, which suggests that your test for IsNull is
not producing the expected results. Marshall's suggested code assumed that
CaseNumber and OfficerNumber are number fields. Is that accurate?
I will repeat what I have suggested before: search for one variable. Put
an apostrophe in front of every line of code from If Not
IsNull(tbxCaseNumber) Then and the End If just before Debug.Print. You are
now searching just for the date. Run the code. If it produces the expected
result, remove the apostrophes from the lines of code that test for
tbxCaseNumber, and run the code again. If there is a problem, stop right
there and solve it.
It would help to see the code you are actually using.
Regarding the record source table, I have lost track of what you are trying
to do. Are the fields in the string from the main form's record source?
However, the first step is to get the expected string. Right now it can't
work, no matter the record source.
<rstiles@xxxxxxxxxxxxxxxxxxxxx> wrote in message
news:1168269470.600005.250970@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Actually I was wrong, and before I go further I should make sure that
my understanding of debug.print is correct. When I run this code the
results of debug.print are in the imediate window. If that is correct,
this is what is showing up when I am searching for 11/27/2005:
SELECT CNDate, CaseNumber, Officer, OfficerNumber, Incident,
Description FROM tblCaseNumber WHERE CNDate =#11/27/2005# AND
CaseNumber= AND OfficerNumber= AND Incident="" ORDER BY CaseNumber
DESC
This also showing up in the row source for the list box properties as
well with no results just a blank screen.
Does it matter that the subforms record source property is pointing to
the table?
Ron
.
- References:
- Re: Compile error: Block If without If
- From: rstiles
- Re: Compile error: Block If without If
- From: BruceM
- Re: Compile error: Block If without If
- From: rstiles
- Re: Compile error: Block If without If
- From: Marshall Barton
- Re: Compile error: Block If without If
- From: rstiles
- Re: Compile error: Block If without If
- From: Marshall Barton
- Re: Compile error: Block If without If
- From: rstiles
- Re: Compile error: Block If without If
- From: Marshall Barton
- Re: Compile error: Block If without If
- From: rstiles
- Re: Compile error: Block If without If
- From: BruceM
- Re: Compile error: Block If without If
- From: rstiles
- Re: Compile error: Block If without If
- Prev by Date: Re: finding number in text
- Next by Date: Datasheet Headings
- Previous by thread: Re: Compile error: Block If without If
- Next by thread: Re: Compile error: Block If without If
- Index(es):
Relevant Pages
|