Solved

SSDBGRID how to set text

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…

863 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

23 Experts available now in Live!

Get 1:1 Help Now