Access VBA - CurrentDb.Recordsets is empty

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sphinney
    New Member
    • Mar 2007
    • 69

    Access VBA - CurrentDb.Recordsets is empty

    As my Access form opens, I want it to find the names of the tables in the current Access database and populate a combobox with the table (recordset) names. Problem is, the CurrentDb.Recor dsets object is empty even though I have two tables in the database. I'm using the code below, but the combobox remains empty. That's because CurrentDB.Recor dsets is empty. Is this a bug with CurrentDb or have I done something dumb?

    Dim TBL As DAO.Recordset

    For Each TBL In CurrentDb.Recor dsets
    Combobox.RowSou rce = Combobox.RowSou rce & TBL.Name & ";"
    Next TBL
  • sphinney
    New Member
    • Mar 2007
    • 69

    #2
    My appologies. I've posted this to the wrong forum. I'll re-post in the Access forum.

    Originally posted by sphinney
    As my Access form opens, I want it to find the names of the tables in the current Access database and populate a combobox with the table (recordset) names. Problem is, the CurrentDb.Recor dsets object is empty even though I have two tables in the database. I'm using the code below, but the combobox remains empty. That's because CurrentDB.Recor dsets is empty. Is this a bug with CurrentDb or have I done something dumb?

    Dim TBL As DAO.Recordset

    For Each TBL In CurrentDb.Recor dsets
    Combobox.RowSou rce = Combobox.RowSou rce & TBL.Name & ";"
    Next TBL

    Comment

    Working...