Table dose not exist

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Guy Moseley
    New Member
    • Jun 2007
    • 5

    Table dose not exist

    Hi all,

    Could someone please point me in the right direction!

    I am in the process of creating an Ms Access db and as part of this use VBA in a form to create a table based on the input to the form.
    The VBA is run as a result of clicking a button, creates the table and then opens a new form with a sub form based on the new table.

    However this bit dose not work and you get the message "Table dose not exist"
    The table dose not appear in the database window until you click on another tab and then back to Tables.

    This leads me to think that I need some way to refresh the list of tables before opening the new form.

    Any thoughts or comments most welcome
  • puppydogbuddy
    Recognized Expert Top Contributor
    • May 2007
    • 1923

    #2
    Originally posted by Guy Moseley
    Hi all,

    Could someone please point me in the right direction!

    I am in the process of creating an Ms Access db and as part of this use VBA in a form to create a table based on the input to the form.
    The VBA is run as a result of clicking a button, creates the table and then opens a new form with a sub form based on the new table.

    However this bit dose not work and you get the message "Table dose not exist"
    The table dose not appear in the database window until you click on another tab and then back to Tables.

    This leads me to think that I need some way to refresh the list of tables before opening the new form.

    Any thoughts or comments most welcome
    Try adding this line of code after you've finished creating the tables and before creating the form:

    db.TableDefs.Re fresh 'replace db with the database object that you created

    Comment

    • Guy Moseley
      New Member
      • Jun 2007
      • 5

      #3
      Sorry for the delay getting back to you but my PC died!!!

      Many thanks for the super quick reply.
      I tried it but couldn’t get it to work however it did point me in the right direction and I used CurrentDB and that worked

      Many thanks again

      Comment

      Working...