Run-time error '91'

vb6 , data , error 91 Romania
  • 11 years ago
    Hello, I am trying to make a program to access a Microsoft Access '97 database in VB 6.0. I am using a data control (named datBD), with the DatabaseName and Recordsource properties set accordingly. On loading the main form in the program i have the following code: datBD.Recordset.MoveFirst The program keeps showing me a "Run-time error '91': Object variable or with block variable not set". But if I make a button on the form, write the same code and then press it, it works. I am a beginner and I can't understand why this is happening. Please tell me what I should do to make it work on loading the program? Thank you.

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” - Tom Cargill