none
"RUN-TIME ERROR '3078': The Microsoft Access database engine cannot find the input table or query 'name'. Make sure it exists and that its name is spelled correctly. RRS feed

  • Question

  •  When I run the code below I get the following error:"RUN-TIME ERROR '3078': The Microsoft Access database engine cannot find the input table or query 'False'. Make sure it exists and that its name is spelled correctly. Note that I do not call anything by the name of "false" anywhere in this code.

                                                                                                   

    The subject code (the underscored line of code is highlighted in the debugger when the error occurs):

    Option Compare Database
    
    Private Sub JobAssign_Click()
     MatLotListAvail_openform
     
    End Sub
    Function MatLotListAvail_openform()
    
        Dim dbsAPIShopManager2010 As DAO.Database
        Dim rstMaterialLotJobJoint As DAO.Recordset
        Dim strSQL As String
           
        
            Set dbsAPIShopManager2010 = CurrentDb
            
            strSQL = "SELECT * FROM MaterialLotJobJoint WHERE JobID" = "tempvars!JobID" And "MatLotID" = "tempvars!MatLotID"
            Set rstMaterialLotJobJoint = dbsAPIShopManager2010.OpenRecordset(strSQL, dbOpenDynaset)
            
            If rstMaterialLotJobJoint.EOF Then
               
                DoCmd.OpenForm "JobAssignMatConf", acNormal, "", "", acEdit, acNormal
                Forms!JobAssignMatConf!PartapiIDVH = TempVars!PartapiID
                Forms!JobAssignMatConf!JobapiIDVH = TempVars!JobapiID
                Forms!JobAssignMatConf!JobIDVH = TempVars!JobID
                Forms!JobAssignMatConf!MaterialLotIDVH = TempVars!MatLotID
                Forms!JobAssignMatConf!Desc = TempVars!MatDesc
                Forms!JobAssignMatConf!recdate = TempVars!recdate
                DoCmd.Close acForm, "MaterialLotListAvailable"
                
            Else: MsgBox "This material lot has already been assigned to this job."
                DoCmd.Close acForm, "MaterialLotListAvailable"
                
            End If
                            
    
    End Function




    • Edited by les2worry Sunday, January 18, 2015 10:01 PM formatting
    Sunday, January 18, 2015 9:52 PM

Answers

  • I think the SQL statement should be

        strSQL = "SELECT * FROM MaterialLotJobJoint WHERE JobID=" & _
            tempvars!JobID & " AND MatLotID=" & tempvars!MatLotID

    This assumes thatJobID and MatLotID are number fields.


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    • Marked as answer by les2worry Sunday, January 18, 2015 11:57 PM
    Sunday, January 18, 2015 10:12 PM

All replies

  • I think the SQL statement should be

        strSQL = "SELECT * FROM MaterialLotJobJoint WHERE JobID=" & _
            tempvars!JobID & " AND MatLotID=" & tempvars!MatLotID

    This assumes thatJobID and MatLotID are number fields.


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    • Marked as answer by les2worry Sunday, January 18, 2015 11:57 PM
    Sunday, January 18, 2015 10:12 PM
  • Thank you Hans,

    It worked like a charm.


    Les M.

    Sunday, January 18, 2015 11:58 PM