Try mine :DQuote:
Originally posted by WiseGuy
Muddy code does work, I'm just trying to find out when to trigger the code :S
WiseGuy
Printable View
Try mine :DQuote:
Originally posted by WiseGuy
Muddy code does work, I'm just trying to find out when to trigger the code :S
WiseGuy
Everything works fine now, This is how my code looks like right now:
VB Code:
Set cn = New ADODB.Connection cn.ConnectionString = "Data Source=spijsDB;User ID=spijs;Password=spijs;" cn.Open Set rs = New ADODB.Recordset grdDataGrid.Refresh cn.CursorLocation = adUseServer strSQL = "select a.artikelID, a.productcode, a.artikelnaam, b.typecode, TO_CHAR(a.tolerantiepluskg), c.celnaam, TO_CHAR(a.natdroogverh) from artikelen a, artikeltype b, cellen c" rs.Open strSQL, cn Set grdDataGrid.DataSource = rs grdDataGrid.Refresh grdDataGrid.TextMatrix(0, 1) = "Nummer" grdDataGrid.TextMatrix(0, 2) = "Product Code" grdDataGrid.TextMatrix(0, 3) = "Artikel" grdDataGrid.TextMatrix(0, 4) = "Artikeltype" grdDataGrid.TextMatrix(0, 5) = "Tolerantie (KG)" grdDataGrid.TextMatrix(0, 6) = "Celnaam" grdDataGrid.TextMatrix(0, 7) = "Nat/Droog verhouding"
Sir Frog,Quote:
Originally posted by mendhak
I mean
how can you bind a flexgrid.
(forget the runtime part)
When the Datasource property is set, I consider the grid "bound". Of course I could very well have my terminology screwed up.
I mean, after all, I am just a bluesman impersonating a programmer. :D
Bluesman,Quote:
Originally posted by Muddy
Sir Frog,
When the Datasource property is set, I consider the grid "bound". Of course I could very well have my terminology screwed up.
I mean, after all, I am just a bluesman impersonating a programmer. :D
previously you confused me.
Now you're scaring me! :eek: (kidding!)
OK, I checked, and flexgrids don't have a datasource property. Are we talking about the same flexgrid here? MSFLEXGRID. That's what I have. I have to connect it to the db, and manipulate everything through code.
How is it that you talk about a datasource property which I know not of?
(btw, lara stays here! :D)
Sir Frog,Quote:
Originally posted by mendhak
Bluesman,
previously you confused me.
Now you're scaring me! :eek: (kidding!)
OK, I checked, and flexgrids don't have a datasource property. Are we talking about the same flexgrid here? MSFLEXGRID. That's what I have. I have to connect it to the db, and manipulate everything through code.
How is it that you talk about a datasource property which I know not of?
(btw, lara stays here! :D)
After reading your post and sig I am convinced of 2 things:
1) you are stoned
2) i am stupid
:D LOL
My MSFlexGrid has a datasource property. So does WiseGuy's ... check out the code he posted
Answer: 1. I'm stoned. (just a bit)Quote:
Originally posted by Muddy
Sir Frog,
After reading your post and sig I am convinced of 2 things:
1) you are stoned
2) i am stupid
:D LOL
My MSFlexGrid has a datasource property. So does WiseGuy's ... check out the code he posted
I checked AGAIN... and for some strange reason, it's THERE!!! (conspiracy?????)
Just one more quick question, if you're still looking at this post...
the datasource applies for things like ADODC and the normal datacontrol, right?
Hope you're looking, otherwise, I'll put up a new post after 10 minutes if you don't answer.
Quote:
Originally posted by mendhak
(btw, lara stays here! :D)
Hang on and I'll wake her up and give her the message :D
[QUOTE]Originally posted by mendhak
(Just one more quick question, if you're still looking at this post...
the datasource applies for things like ADODC and the normal datacontrol, right?
those or an ADO Recordset ...
Muddy, the below works fine but it doens't save any changes I make in the MSFlexGrid. How do you save any changes??
Lintz.
Quote:
Originally posted by Muddy
hmm, this works ... got if off a thread ... dont remeber from who
but you can edit the msflexgrid ... give it a try
VB Code:
Private Sub MSFlexGrid1_KeyPress(KeyAscii As Integer) With MSFlexGrid1 Select Case KeyAscii Case 8: 'IF KEY IS BACKSPACE THEN If .Text <> "" Then .Text = _ Left$(.Text, (Len(.Text) - 1)) Case 13: 'IF KEY IS ENTER THEN Select Case .Col Case Is < (.Cols - 1): SendKeys "{right}" Case (.Cols - 1): If (.Row + 1) = .Rows Then .Rows = .Rows + 1 End If SendKeys "{home}" + "{down}" End Select Case Else .Text = .Text + Chr$(KeyAscii) 'write your own keyascii Validations under 'commented lines Select Case .Col Case 0, 1, 2: 'if (your condition(s)) then 'accept only charectors 'Else ' keyascii=0 'End If Case Else: End Select End Select End With End Sub
I suppose you would have to write the cells to some sort of file (delimited text, mdb, csv. etc)
That's right Muddy
The back end of my app is run by an Access DB. Once I populate the MSFlexGrid how do I then save any changes to a particular record in my DB??