Re: Compile error: Block If without If

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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



.



Relevant Pages

  • Re: refer to combo box from a query - please advise me
    ... how to call a function to populate a control; ... from controls to a stored procedure used as the record source but this ... I don't understand the part where you said the I must build a string to be ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Looking for a little education on VBA code
    ... The bound column of the combo and the ... it doesn't need to be a string. ... format. ... currently located in the record source (a new 'bookmark' is created ...
    (microsoft.public.access.gettingstarted)
  • Re: Select a single record from a subform for editing.
    ... called form has a record source - maybe "recordID". ... Dim stLinkCriteria As String ... have used the same tables and queries that are used on subform as the ...
    (microsoft.public.access.formscoding)
  • RE: User filtering
    ... If the form that i'm using has this query as a record source instead of the ... Private Declare Function GetUserNameA Lib "Advapi32" (ByVal strN As String, ... Public Function GetUserID() ...
    (microsoft.public.access.formscoding)
  • RE: Is this possible?
    ... How I make the query the record source of the subform? ... Public Function funcCorrerSQL(strCmdSQL As String, strParametro As String, ...
    (microsoft.public.access.modulesdaovba)