Solved

SSDBGRID how to set text

Posted on 1997-04-29
4
1,246 Views
Last Modified: 2012-05-04
Hi, My proble is that i dont seem to be able to set text
to a ssdbgrid colum I've tried this
SSDBGrid1.colums(1).text = MyStr     I've also tried this
SSDBGrid1.colums(1).text = "text"    and
SSDBGrid1.colums(1).text = MyRs!fieldname
ps. if set the properties to bound mode
But nothing seems to work!
Is there a other way of setting text to the ssdbgrid?
0
Comment
Question by:ec97-44
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 

Author Comment

by:ec97-44
ID: 1425796
Edited text of question
0
 
LVL 7

Expert Comment

by:tward
ID: 1425797
If it is anything like a regular grid try the following:

SSDBGrid1.Row=1
SSDBGrid1.Col=1
SSDBGrid1.text="TEXT"

In a grid you have to pick your row and column first then set the text of that row/column to what you want...  Hope this helps you out!
0
 

Author Comment

by:ec97-44
ID: 1425798
I 've reasently solved the problem my self and the solution looks
like this
SSDBGrid1.columns(1).text = MyText
The problem that i had was following:
1. I tried to set text to a column that was bounded to an key field
2.I had misspeld columns like this colums whitout n after m

I havent tried your solution but i don't think that would work
because the ssdbgrid is in bounded mode and textpropertis can only be put in the way i did.
My result for your solution can only be rated to poor but thanks
anyway
0
 

Accepted Solution

by:
mikekr earned 100 total points
ID: 1425799
If the SSDBGrid is in bound mode, and you are trying to add new data to the grid, the easiest way is to add it to the recordset.
i.e. If SSDBGrid1 is bound to Data1, use this code :-

Data1.recordset.addnew
Data1.recordset!fieldname1=data1
Data1.recordset!fieldname2=data2
Data1.recordset.update

That should add a new row to the grid and display the data that was entered.

If the SSDBGrid is in additem mode then use the AddItem method:-

SSDBGrid1.AddItem data1,data2

This would add a new row and enter the value of data1 into column 0 and the value of data2 into column1. NB! The FieldSeparator property of SSDBGrid1 must be set to "," for this code to work.

If you want to programatically change the contents of a cell in the grid. Make sure you are on the correct row in the grid, and use:-

SSDBGrid1.columns(0).text=Mytext1
SSDBGrid1.columns(1).text=Mytext2

You could also use the following code to change the contents of the recordset that is bound to SSDBGrid1:-

Data1.recordset.edit
Data1.recordset!fieldname1=data1
Data1.recordset!fieldname2=data2
Data1.recordset.update

Of course, there are various ways of making sure that you are in the correct row of the grid or that you are pointing at the correct record in the recordset before the changes are made.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question