Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2004
    Location
    Blackburn, UK
    Posts
    169

    Unanswered: Insert Into Question

    I want to insert into a table a result returned from a variable in code

    Code so far

    Code:
    Dim X1 As Variant
    
        
        Dim rcs As DAO.Recordset
        Dim SQL As String
        Dim SQL2 As String
        
        SQL = "Select [Site Maintainance Due].*"
        SQL = SQL + " From [Site Maintainance Due]"
        SQL = SQL + " Order By [Site Maintainance Due].SiteMNSiteID"
        
        SQL2 = "INSERT INTO [Maintainance Temp] ( SiteMNSiteID )" & X1
        
        Set rcs = CurrentDb.OpenRecordset(SQL, dbOpenDynaset)
        
            rcs.MoveFirst
        
        X1 = rcs("SiteMNSiteID")
        DoCmd.RunSQL SQL2
    I dont know how to insert X1 into the table?
    Last edited by ChrisGolden; 09-30-04 at 18:42.

  2. #2
    Join Date
    Jul 2004
    Location
    Blackburn, UK
    Posts
    169
    Doesnt matter, i have done it!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •