CurrentDB openRecordset search failed....

Giganews Newsgroups
Subject: CurrentDB openRecordset search failed....
Posted by:  SpankyTClown (christopher.ly…@gmail.com)
Date: 17 Aug 2006

I am trying to copy a record with child records. The process is to copy
the parent and then search the child tables for record related to the
parent.  When I try to search the child table for all related records I
get the following error:
        Syntax error (missing operator) in query expression
'Configuration Id=28"'

I have shown the code below, any help would be appreciated.

---------------------------------------------------------------------------------------------------------------
On Error GoTo Err_cmd_Modify_Click

    ' Get the configuration id that is being copied
    Me![sourceCI] = Me![Configuration Id]

    ' Copy the Configuration Item record
    DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
    DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
    DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste
Append

    ' Move to the last record in the table
    DoCmd.GoToRecord , , acLast

    ' Update the revision number
    Me![RevisionNumber] = Me![RevisionNumber] + 1

    ' Get the new configuration id
    newCI = Me![Configuration Id]

    ' create a recordset with the DHS information for this CI
    searchSQL = "Select * from Tbl_DHSDetails where Configuration Id =
" & newCI & """"

    Set fromrec = CurrentDb.OpenRecordset(searchSQL)
    fromrec.MoveFirst

Exit_cmd_Modify_Click:
    Exit Sub

Err_cmd_Modify_Click:
    MsgBox Err.Description
    Resume Exit_cmd_Modify_Click

Replies