runtime error 91

object variable or with block variable not set

Page 1 of 1

3 Replies - 1150 Views - Last Post: 09 October 2009 - 02:44 AM Rate Topic: -----

#1 exekiel  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 02-October 09

runtime error 91

Post icon  Posted 05 October 2009 - 12:13 AM

may someone do help to debug my project cause when i runned my program it always show the same error on my form 2 of my project which is object variable or with block variable not set,,,thanks for someone who will give time to view and debug my problem..

Private Sub cmd_backtank1_Click()
Unload Me
Form1.Show
End Sub


Public Sub cmd_enter_Click()

Adodc1.Recordset.Fields("tank_number") = lbl_tank1.Caption
Adodc1.Recordset.Fields("date") = lbl_date.Caption
Adodc1.Recordset.Fields("time") = lbl_time.Caption

Adodc1.Recordset.Fields("updates") = txt_valuetank1.Text
Adodc1.Recordset.Save

If txt_valuetank1.Text = "100" Or txt_valuetank1.Text >= 95 Then
Shape1.Visible = True
Else
If txt_valuetank1.Text >= "94" Or txt_valuetank1.Text >= 85 Then
Shape6.Visible = True
Else
If txt_valuetank1.Text >= "84" Or txt_valuetank1.Text >= 75 Then
Shape2.Visible = True
Else
If txt_valuetank1.Text >= "74" Or txt_valuetank1.Text >= 65 Then
Shape7.Visible = True
Else
If txt_valuetank1.Text >= "64" Or txt_valuetank1.Text >= 55 Then
Shape3.Visible = True
Else
If txt_valuetank1.Text >= "54" Or txt_valuetank1.Text >= 45 Then
Shape8.Visible = True
Else
If txt_valuetank1.Text >= "44" Or txt_valuetank1.Text >= 35 Then
Shape4.Visible = True
Else
If txt_valuetank1.Text >= "34" Or txt_valuetank1.Text >= 25 Then
Shape9.Visible = True
Else
If txt_valuetank1.Text >= "24" Or txt_valuetank1.Text >= 15 Then
Shape5.Visible = True
MsgBox "warning low oxygen supply", vbOKOnly
Else
If txt_valuetank1.Text >= "14" Or txt_valuetank1.Text >= 5 Then
Shape10.Visible = True
MsgBox "warning low oxygen supply", vbOKOnly
Else
If txt_valuetank1.Text >= "4" Or txt_valuetank1.Text >= 0 Then
Shape11.Visible = True
MsgBox "change tank", vbOKOnly
Else
MsgBox "cant be allocated", vbOKOnly
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If

End Sub

Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\maricel\db3.mdb;Persist Security Info=False"
Adodc1.RecordSource = "select * from monitor"
Adodc1.Recordset.AddNew
lbl_tank1.Caption = Form5.lbl_tank1.Caption
lbl_date.Caption = Date
lbl_time.Caption = Time
End Sub



Is This A Good Question/Topic? 0
  • +

Replies To: runtime error 91

#2 olibenu  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 45
  • View blog
  • Posts: 537
  • Joined: 31-December 08

Re: runtime error 91

Posted 05 October 2009 - 02:20 AM

which line gives the error
Was This Post Helpful? 0
  • +
  • -

#3 exekiel  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 02-October 09

Re: runtime error 91

Posted 06 October 2009 - 02:33 AM

View Postolibenu, on 5 Oct, 2009 - 01:20 AM, said:

which line gives the error


in this line have an error
Adodc1.Recordset.Fields("tank_number") = lbl_tank1.Caption
Adodc1.Recordset.Fields("date") = lbl_date.Caption
Adodc1.Recordset.Fields("time") = lbl_time.Caption

Adodc1.Recordset.Addnew



after i remove that code my program do run smoothly without error..
Was This Post Helpful? 0
  • +
  • -

#4 thava  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 179
  • View blog
  • Posts: 1,598
  • Joined: 17-April 07

Re: runtime error 91

Posted 09 October 2009 - 02:44 AM

check the fields are available in the table or check whether it is in eof or bof
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1