Results 1 to 5 of 5

Thread: Object variable not set

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Posts
    19

    Post

    I've opened a MS Access database by using this code:

    Set DBMain = OpenDatabase(App.Path & "\Main.mdb")
    Set RSMain = DBMain.OpenRecordset("Select * From MAIN")

    Now I want to display the database information into a flexgrid control. But when I add this line:

    Set FlexMain.DataSource = DBMain

    it comes with the error message "Object variable or With block variable not set".

    What am I doing wrong?

    Thanks in advance.

  2. #2
    Member
    Join Date
    Aug 2000
    Location
    calcutta,india
    Posts
    48
    please refresh recordset object then run your program

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Posts
    19
    When using a data control, refreshing the recordset object would work, but now I can't seem to get it right. The only refresh method I could find is

    DBMain.Recordsets.Refresh

    but this gave the same error message.

    Anyway, thanks for your reply.

  4. #4
    Addicted Member
    Join Date
    Jan 2000
    Location
    Oshkosh, WI
    Posts
    163
    I think you need to set the datasource property equal to the recordset RSMAIN

    Set FlexMain.DataSource = RSMain
    Glenn D
    Development/Analyst

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Posts
    19
    Nope, that didn't work either; the same result.

    Thanks anyway!

Posting Permissions

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



Click Here to Expand Forum to Full Width