[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 142
  • Last Modified:

Quick question!

I am a student who is trying to finish a final project, but I am incredibly stuck at one seemingly simple step. I have a number of text boxes on a tabbed form that will have information typed in by the user. I am then supposed to have the user click on a command to add the information to a MSFlexGrid. I cannot seem to figure out how to do this. I have tried AddItem to no avail : MSFlexGrid1.AddItem txtStateTaxRate for example. Any suggestions??
0
hefnerta
Asked:
hefnerta
1 Solution
 
LewyCommented:
Do you get any errors?
0
 
Éric MoreauSenior .Net ConsultantCommented:
I had always use MSFlexGrid bounded. So add your data to your recordset and refresh your grid.
0
 
hefnertaAuthor Commented:
No, no errors at all.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Erick37Commented:
Use:
MSFlexGrid1.AddItem txtStateTaxRate.Text

Also make sure you have
Option Explicit
as the first line of your code, before anything.  This will prevent you from using unDimmed variables.  If the program cannot find txtStateTaxRate, it will tell you.
0
 
vbWayneCommented:
Works for me

MSFlexGrid1.AddItem "Wayne"
MSFlexGrid1.AddItem Text1


0
 
hesCommented:
Dim GridRow
Dim RowCount
 
 GridRow = 0
 MSFlexGrid1.Rows = GridRow + 1
 MSFlexGrid1.Row = GridRow
 MSFlexGrid1.Col = 0
 MSFlexGrid1.Text = txtStateTaxRate
 MSFlexGrid1.Col = 1
 MSFlexGrid1.Text = txtNextData
0
 
vbWayneCommented:
an afterthought...
If you use multiple forms you have to
add  
MsFlexGrid1.AddItem FormWhatever.txtStateTaxRate
0
 
halapayaCommented:
Try this way

Private Sub MsFlexGrid1_Click ()
   MSHFlexGrid1.Additem 'adds a row
  ' Put text in third row, third column.
   MSHFlexGrid1.Col = 2
   MSHFlexGrid1.Row = 2
   MSHFlexGrid1.Text = "There"
End Sub

also u can use

MSHFlexGrid1.TextMatrix(1, 1) ="blah"

here it'll add blah, to row=1 col=1

First you have to add a row using
Additem method, then use either
TextMatrix(row,col) or set the row and col first and then use the Text method

hope this helps.
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now