Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SSDBGRID how to set text

Posted on 1997-04-29
4
Medium Priority
?
1,285 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 300 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

705 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