Solved

SSDBGRID how to set text

Posted on 1997-04-29
4
1,193 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
  • 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

709 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now