Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi i have 3 text boxes
one command button
one datagrid

What i want is click on command button data from textboxe add in datagrid

i tried this but getting run time error 7005 "Rowset not available"
Please help

VB
     With DataGrid1
        .AllowAddNew = False
        .AllowDelete = False
        .AllowUpdate = False

Dim col As Column

Set col = DataGrid1.Columns.Add(0)
    col.Value = Text1(0).Text
    col.Caption = "Article"

End With
Posted
Updated 14-Sep-13 3:51am
v3
Comments
[no name] 14-Sep-13 9:16am    
https://forums.digitalpoint.com/threads/vb-question.12247/
khan2010 14-Sep-13 10:40am    
Thanks for reply
But In my scenario.. there is no any database.
Just want to add Records in grid from text boxes.
[no name] 14-Sep-13 10:50am    
So? What does that have to do with anything?
abbaspirmoradi 14-Sep-13 9:17am    
Put your code here......
khan2010 14-Sep-13 9:20am    
With DataGrid1
.AllowAddNew = False
.AllowDelete = False
.AllowUpdate = False

Dim col As Column

Set col = DataGrid1.Columns.Add(0)
col.Value = Text1(0).Text
col.Caption = "Article"

End With

 
Share this answer
 
Comments
khan2010 14-Sep-13 12:15pm    
But sir i dont have any database, i just wanted to add whatever data is in text boxes into datagrid.
Maciej Los 14-Sep-13 12:20pm    
So what?
Menon Santosh 14-Sep-13 12:18pm    
my+5
Maciej Los 14-Sep-13 12:19pm    
Thank you ;)
 
Share this answer
 
Thanks for helping me guys.
according to ridoy suggestion i got this solution, but with MSHFlexGrid not datagrid and its working fine.


XML
<pre lang="vb">

Dim intRow As Integer

MSHFlexGrid1.Rows = MSHFlexGrid1.Rows + 1 ' If you need to increase the number of rows

With MSHFlexGrid1

    .TextMatrix(intRow + 1, 1) = Text1.Text
    .TextMatrix(intRow + 1, 2) = Text2.Text
    .TextMatrix(intRow + 1, 3) = Text3.Text
end with
     intRow = intRow + 1

</pre>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900