Results 1 to 1 of 1
  1. #1
    lzook88 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2015
    Posts
    75

    VBA Run Time Error - Table Not Found

    SOLVED!!!!!! was missing "SELECT" from the code.. OOPS!


    Hey all. I have a button coded in VBA to submit the data to a table in my database. When I press the button i get this:

    Code:
    Run-time error '3078':
    
    The Microsoft Access database engine cannot find the input table or query 'Oname, Oaddress, OCity, OState, OZip, OPhone FROM tblOffice'.
    Make sure it exists and that its name is spelled correctly
    The code is this:

    Code:
    Private Sub Command13_Click()
    Dim rs As DAO.Recordset
    Dim db As Database
    
    Set db = CurrentDb
    Set rs = db.OpenRecordset("Oname, oaddress, ocity, ostate, ozip, ophone FROM tblOffice")
    
    With rs
        .AddNew
        !OName = Me.OName
        !OAddress = Me.OAddress
        !OCity = Me.OCity
        !OState = Me.OState
        !OZip = Me.OZip
        !OPhone = Me.OPhone
        .Update
    End With
    
    rs.Close
    
    DoCmd.Close , , acSaveNo
    
    End Sub
    And the table is this:

    Name - tblOffice
    OfficeID - AutoNumber
    OName - Short Text
    OAddress - Short Text
    OCity - Short Text
    OState - Number (Looks up value from State Table)
    OZip - Short Text
    OPhone - Short Text


    Thanks in advance for your help.
    Z
    Last edited by RuralGuy; 02-27-2016 at 01:18 PM. Reason: Fixed Title Spelling

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Run-Time Error '3265': Item Not Found In This Collection
    By Voodeux2014 in forum Programming
    Replies: 3
    Last Post: 01-29-2016, 09:04 AM
  2. Runt time error 3164 field can not be updated
    By sprtrmp in forum Programming
    Replies: 12
    Last Post: 10-27-2015, 07:06 AM
  3. Replies: 2
    Last Post: 08-28-2015, 01:45 AM
  4. Replies: 1
    Last Post: 01-13-2015, 01:33 PM
  5. Replies: 7
    Last Post: 06-08-2012, 09:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums