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

x
?
Solved

checkbox for my datagrid in vb6

Posted on 2009-07-10
15
Medium Priority
?
1,859 Views
Last Modified: 2012-05-07
I have a column in my datagrid that I would like to display as a checkbox.  It is my 5th column.  I am using vb6.  Is there a way to turn that column into a checkbox answer.
0
Comment
Question by:al4629740
[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
  • 7
  • 5
  • 3
15 Comments
 
LVL 10

Expert Comment

by:3_S
ID: 24834469
see example
http://www.codeguru.com/vb/gen/vb_database/datagrid/article.php/c7587/

Basicly you have to link a checkbox onto your datagrid.

If you need more explanation feel free to ask.
0
 

Author Comment

by:al4629740
ID: 24837437
Can you provide a little more help?  How do I link a checkbox onto the datagrid?
0
 

Author Comment

by:al4629740
ID: 24837440
raised points
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 13

Expert Comment

by:game-master
ID: 24837475


good afternoon?
are u stock on using the datagrid??

u can use msFlexgrid and u can add some tweak to add a checkbox
on a desired column u want....

game-master
0
 
LVL 10

Expert Comment

by:3_S
ID: 24843075
to add a checkbox in datagrad add one checkbox on your form and set index property of checkbox to 0
Then with the provided code you create an array of checkboxes into your datagrid.
One thing you must pay attention to is that your datagrid can scroll and that you must link the correct checkbox to the corresponding record in you datagrid.

The site on codeguru has an example. Do you need another example?
0
 

Author Comment

by:al4629740
ID: 24843119
So thats the only option?
0
 

Author Comment

by:al4629740
ID: 24843121
Its like a floating checkbox?
0
 
LVL 10

Expert Comment

by:3_S
ID: 24843569
Yes no other option when using datagrid.
You can use 3rd party component if you want but I don't know a free one to solve your problem.

It's kind of a floating checkbox. you put a checkbox into the column, one for each row.
0
 
LVL 13

Expert Comment

by:game-master
ID: 24845397


like what i have said before...
if u want to see checkbox on ur grid, then use flexgrid rather that datagrid...


game-master
0
 

Author Comment

by:al4629740
ID: 24846012
Is it hard to switch it over to flexgrid?  What changes in my code?  If its too much to do, then I may just abort the whole thing.
0
 
LVL 13

Expert Comment

by:game-master
ID: 24846215


adding data to flexgrid from the database it very easy to do...
0
 

Author Comment

by:al4629740
ID: 24846286

Would this bind the datasource?

      rec.CursorType = adOpenDynamic
      rec.CursorLocation = adUseClient
      rec.LockType = adLockOptimistic
      rec.Open esql, conn, , , adCmdText



     
        Set MSFlexGrid1.DataSource = rec
0
 
LVL 13

Accepted Solution

by:
game-master earned 1600 total points
ID: 24846334


unfortunately it does not work in that way...

but to add data to the flexgrid is as simple as this way...


rec.CursorType = adOpenDynamic
      rec.CursorLocation = adUseClient
      rec.LockType = adLockOptimistic
      rec.Open esql, conn, , , adCmdText


do until rec.eof
 
 myFlexgrid.additem rec!field1 & vbtab & rec!field2 & vbtab & rec!field3  ...

rec.movenext
loop


game-master
0
 

Author Closing Comment

by:al4629740
ID: 31602333
Would the checkbox be a floating for the MSFlexGrid also?
0
 
LVL 13

Expert Comment

by:game-master
ID: 24846356


yes it will...
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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

670 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