Connecting Tech Pros Worldwide Help | Site Map

Runtime error 91

  #1  
Old November 26th, 2008, 08:35 AM
Familiar Sight
 
Join Date: Jan 2008
Posts: 135
Hello everyone..
I m working on VB6 and SQLServer 2000.... i m getting an error in this line..


Private Sub txtAdjAmt_KeyPress(KeyAscii As Integer)
Dim vI As Integer
vI = LVPO.SelectedItem.Index
If KeyAscii = 13 Then
LVPO.ListItems(vI).SubItems(4) = txtAdjAmt.Text
txtAdjAmt.Visible = False
End If

Dim vI1 As Integer
vI1 = LvBill.SelectedItem.Index
If KeyAscii = 13 Then
LvBill.ListItems(vI1).SubItems(4) = txtAdjAmt.Text
txtAdjAmt.Visible = False
End If
End Sub


is anyone there to help me out to remove the error... there is a textbox when i press any key it give an error as " object variable or with block variable not set"
plz help me.
thank u in advance
  #2  
Old November 26th, 2008, 08:46 AM
QVeen72's Avatar
Moderator
 
Join Date: Oct 2006
Location: Bangalore
Posts: 1,384

re: Runtime error 91


Hi,

May be, No Item is selected in the list view "LvBill"

Regards
Veena
  #3  
Old November 26th, 2008, 09:10 AM
Familiar Sight
 
Join Date: Jan 2008
Posts: 135

re: Runtime error 91


Hi

the selection is done bt still i m getting the same error.
can u help me out
thank u
  #4  
Old November 26th, 2008, 10:45 AM
QVeen72's Avatar
Moderator
 
Join Date: Oct 2006
Location: Bangalore
Posts: 1,384

re: Runtime error 91


Hi,

How are you populating "lvBill"....?
  #5  
Old November 26th, 2008, 11:01 AM
Familiar Sight
 
Join Date: Jan 2008
Posts: 135

re: Runtime error 91


Private Sub LvBill_KeyPress(KeyAscii As Integer)
Dim vI1 As Integer
'If cmbpayType.Text = "B" Then
If LvBill.CheckBoxes = True Then
vI1 = LvBill.SelectedItem.Index
txtadjamt1.Left = LvBill.ColumnHeaders(5).Left + 280

txtadjamt1.Top = LvBill.ListItems(vI1).Top + 3600
txtadjamt1.Height = LvBill.ListItems(vI1).Height
txtadjamt1.Width = LvBill.ColumnHeaders(5).Width
txtadjamt1.Visible = True
txtadjamt1.Text = ""
txtadjamt1.SetFocus
End If
'End If
End Sub


this is my lvbill... i have one more lvbillpo which by filling up the lvbill and saving the listview wil show.. i have to set the adjamt and tdsamt in the lvbill to get tht..
  #6  
Old November 26th, 2008, 12:41 PM
QVeen72's Avatar
Moderator
 
Join Date: Oct 2006
Location: Bangalore
Posts: 1,384

re: Runtime error 91


Hi,

Change you Code like this and Check :

Expand|Select|Wrap|Line Numbers
  1. Private Sub txtAdjAmt_KeyPress(KeyAscii As Integer)
  2. Dim vI As Integer
  3. If KeyAscii = 13 Then
  4.     vI = LVPO.SelectedItem.Index
  5.     LVPO.ListItems(vI).SubItems(4) = txtAdjAmt.Text
  6.     txtAdjAmt.Visible = False
  7. End If
  8.  
  9. Dim vI1 As Integer
  10. If KeyAscii = 13 Then
  11.     vI1 = LvBill.SelectedItem.Index
  12.     LvBill.ListItems(vI1).SubItems(4) = txtAdjAmt.Text
  13.     txtAdjAmt.Visible = False
  14. End If
  15. End Sub
  16.  
Regards
Veena
  #7  
Old November 28th, 2008, 06:20 AM
Familiar Sight
 
Join Date: Jan 2008
Posts: 135

re: Runtime error 91


ok.. thank u very much
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
Runtime error 91 Neelesh2007 answers 4 November 29th, 2007 10:17 PM
runtime error 91 moonraker1234 answers 3 April 8th, 2007 09:16 PM
runtime error 91 david stradling answers 3 March 5th, 2007 08:11 AM
vb 6 runtime error'91': ronboris answers 2 August 1st, 2006 04:31 PM
Help - runtime error 91 - object variable not set Peter answers 1 July 17th, 2005 10:31 PM