Re: HELP PLEASE

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Marshall Barton (marshbarton_at_wowway.com)
Date: 03/09/04


Date: Mon, 08 Mar 2004 21:48:56 -0600

Check the first query in your posted code more carefully.

Are you sure that the CaseID field is a numeric type?

I don't have any idea what you mean about a "parameter". I
can't discern the use of any parameters.

-- 
Marsh
MVP [MS Access]
DBarker wrote:
>I am confused, your syntax is the same as mine.  I don't 
>think so, it seems that there has to be an additional 
>parameter added but I am not sure where exactly.
>
>
>Marshall Barton wrote:
>>You forgot the brackets around Journal Date in at least 
>>one place:
>>
>>	strSQL = "SELECT [Journal Date], Journals, " _
>>
>>Is all this trouble caused by you're use of space 
>>characters in names?
>>
>>
>>DBarker wrote:
>>>This is the error message:
>>>Run-Time Error 3075
>>>Syntax Error (Missing operator) in query 
>>>expression "Journal Date"
>>>
>>>I have tried putting journal date in brackets and just 
>>>with an underscore separating the two words.
>>>
>>>Below is the entire code
>>>-------------------------------------
>>>
>>>Public Sub Combine()
>>>
>>>  Dim strSQL As String
>>>  Dim dbs As DAO.Database
>>>  Dim rstFr As DAO.Recordset
>>>  Dim rstTo As DAO.Recordset
>>>  Dim varNoteBatch As Variant
>>>
>>>  Set dbs = CurrentDb()
>>>  strSQL = "SELECT Journal Date, Journals, " _
>>>    & "FROM STi_Table " _
>>>    & "ORDER BY CaseID"
>>>  Set rstTo = dbs.OpenRecordset(strSQL, dbOpenDynaset)
>>>  strSQL = "SELECT [Journal Date], Journals, " _
>>>    & "FROM STi_Multiples " _
>>>    & "ORDER BY CaseID"
>>>  Set rstFr = dbs.OpenRecordset(strSQL, dbOpenSnapshot)
>>>  Do Until rstTo.EOF
>>>    varNoteBatch = Null
>>>    strSQL = "[CaseID]=" & rstTo!CaseID
>>>    rstFr.FindFirst strSQL
>>>    Do Until rstFr.NoMatch
>>>      varNoteBatch = varNoteBatch & "; " _
>>>        & rstFr![Journal Date] & " " & rstFr!Journals
>>>      rstFr.FindNext strSQL
>>>    Loop
>>>    rstTo.Edit
>>>    rstTo!Journals = varNoteBatch
>>>    rstTo.Update
>>>    rstTo.MoveNext
>>>  Loop
>>>
>>>  rstFr.Close
>>>  rstTo.Close
>>>  Set rstFr = Nothing
>>>  Set rstTo = Nothing
>>>End Sub


Relevant Pages

  • Re: Code works - sometimes
    ... Dim objApp As Word.Application ... Dim objDoc As Word.Document ... I can only see your posted code, and in your posted code, you ... "Brendan Reynolds" wrote: ...
    (microsoft.public.access.modulesdaovba)
  • Re: Code works - sometimes
    ... "Brendan Reynolds" wrote: ... Dim objApp As Word.Application ... Note that the Selection property is not a property of the Word.Document ... I can only see your posted code, and in your posted code, you ...
    (microsoft.public.access.modulesdaovba)
  • Problem with filling in Bookmarks in Word
    ... you can still see my first query. ... Sub ReportToWord ... Dim objWord As Object ... Set objWord = CreateObject ...
    (comp.databases.ms-access)
  • Re: HELP PLEASE
    ... Then the only thing I can see wrong is the missing brackets ... >>Check the first query in your posted code more ... >>Are you sure that the CaseID field is a numeric type? ... Dim dbs As DAO.Database ...
    (microsoft.public.access.modulesdaovba)
  • Re: Getting list of users(mail,sn) from Active Directory using LDAP question
    ... It looks like the first query finds an object with SN populated and the ... Joe K. ... > But i get it to working only if i filter using:- ... >>> Dim Mysearcher As New DirectorySearcher ...
    (microsoft.public.dotnet.framework.aspnet.security)