|
-
Oct 17th, 2006, 02:39 AM
#1
Thread Starter
Addicted Member
Problem in Msflexgrid
Hello friends,
I have a form that contains,
Item name------Combo box.
Msflex grid for Item name,qty.
If I select an item name from combo box,that name will be displayed in the
flexgrid first column Item name.Only I have to enter the qty.
If I enter 3 item names and qty like
Item name Qty
A 1
B 2
C 2
If I want to change the item from B to D,error comes.it shows "Enter qty"
It is not changing.How to clear the entire row details and enter a new item
My code:
VB Code:
Private Sub cbomname_KeyPress(KeyAscii As Integer)
On Error Resume Next
If KeyAscii = 13 Then
If c <> 2 Then
If rec.State > 0 Then rec.Close
rec.open "select * from Materials where code='" & cbomname.Text & "'", conn
Text1.SetFocus
Text1.Text = cbomname.Text
c = c + 1
MSFlexGrid1.Col = MSFlexGrid1.Col + 1 Mod MSFlexGrid1.cols
Else: MsgBox "Error, Enter quantity.", vbExclamation, "Items"
End If
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
On Error Resume Next
If KeyAscii = 13 Then
If c = 2 Then
r = r + 1
MSFlexGrid1.rows = r
MSFlexGrid1.Col = 0
MSFlexGrid1.Row = i
MSFlexGrid1.Col = MSFlexGrid1.Col + 1 Mod MSFlexGrid1.cols
Text1.SetFocus
MSFlexGrid1.TextMatrix(i + 1, Col) = r - 1
c = 1
i = i + 1
MSFlexGrid1.Row = MSFlexGrid1.Row + 1 Mod MSFlexGrid1.rows
cbomname.SetFocus
End If
q = i
q = q - 1
end if
-
Oct 17th, 2006, 03:10 AM
#2
Thread Starter
Addicted Member
Re: Problem in Msflexgrid
How to highlight the selected row in flex grid and clear the contents.
-
Oct 17th, 2006, 03:14 AM
#3
Re: Problem in Msflexgrid
-
Oct 17th, 2006, 03:37 AM
#4
Thread Starter
Addicted Member
Re: Problem in Msflexgrid
Thanks.
When I change the selected item,it gives error "Enter qty" without selecting the item!
-
Oct 17th, 2006, 04:12 AM
#5
Re: Problem in Msflexgrid
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|