Connecting Tech Pros Worldwide Help | Site Map

Runtime error 91

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 26th, 2008, 07:35 AM
Familiar Sight
 
Join Date: Jan 2008
Posts: 135
Default Runtime error 91

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
Reply
  #2  
Old November 26th, 2008, 07:46 AM
QVeen72's Avatar
Moderator
 
Join Date: Oct 2006
Location: Bangalore
Posts: 1,383
Default

Hi,

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

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

Hi

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

Hi,

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

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..
Reply
  #6  
Old November 26th, 2008, 11:41 AM
QVeen72's Avatar
Moderator
 
Join Date: Oct 2006
Location: Bangalore
Posts: 1,383
Default

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
Reply
  #7  
Old November 28th, 2008, 05:20 AM
Familiar Sight
 
Join Date: Jan 2008
Posts: 135
Default

ok.. thank u very much
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.