Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

runtime error 91

Status
Not open for further replies.

Jaheel22

Technical User
Jul 14, 2004
84
US
New to VB. Following procedure is producing the runtime error 91 (Object variable or With block variable not set).
Please note i'm using ADO control in my application to access Microsoft Access 2003 database. Any hint ? Thanks

Private Sub btnConfirm_Click()
UserInfo.Recordset.AddNew
UserInfo.Recordset.Fields("userName") = nameBox.Text
UserInfo.Recordset.Fields("Password") = passwordBox.Text
UserInfo.Recordset.Update
Register_Form.Hide
Login_Form.Show
End Sub
 
Error 91 means an object has not be created before it's being used.

"I think we're all Bozos on this bus!" - Firesign Theatre [jester]
 
Which will be the object int this case ?
ADO control (userIno) Or RecordSet ?

If you can write that line, i would apprecaite it.

Thanks
 
If you run in the IDE and set break on all errors it should stop on the line causing the problem. From your code snippet there's no way to tell.

"I think we're all Bozos on this bus!" - Firesign Theatre [jester]
 
It looks just like the UserInfo.Recordset is not opened, or has not been opened yet.
The form that the ADODC is on must have the Connection and RecordSource properties set, and must be already initialized (the form must be loading or loaded).
If however done in code, then the ADODC.Refresh method needs to be called.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top