Runtime error 91 
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
| 
November 26th, 2008, 08:46 AM
|  | 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
| 
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
| 
November 26th, 2008, 10:45 AM
|  | Moderator | | Join Date: Oct 2006 Location: Bangalore
Posts: 1,384
| | | re: Runtime error 91
Hi,
How are you populating "lvBill"....?
| 
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..
| 
November 26th, 2008, 12:41 PM
|  | Moderator | | Join Date: Oct 2006 Location: Bangalore
Posts: 1,384
| | | re: Runtime error 91
Hi,
Change you Code like this and Check : -
Private Sub txtAdjAmt_KeyPress(KeyAscii As Integer)
-
Dim vI As Integer
-
If KeyAscii = 13 Then
-
vI = LVPO.SelectedItem.Index
-
LVPO.ListItems(vI).SubItems(4) = txtAdjAmt.Text
-
txtAdjAmt.Visible = False
-
End If
-
-
Dim vI1 As Integer
-
If KeyAscii = 13 Then
-
vI1 = LvBill.SelectedItem.Index
-
LvBill.ListItems(vI1).SubItems(4) = txtAdjAmt.Text
-
txtAdjAmt.Visible = False
-
End If
-
End Sub
-
Regards
Veena
| 
November 28th, 2008, 06:20 AM
| | Familiar Sight | | Join Date: Jan 2008
Posts: 135
| | | re: Runtime error 91
ok.. thank u very much
|  | | | | /bytes/about
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 225,698 network members.
|