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

x
?
Solved

How Do I Use A Checkbox In A DBGrid

Posted on 1998-10-13
7
Medium Priority
?
221 Views
Last Modified: 2013-12-25
Using VB5 (and/or VB6) I have written a program to track monies owed by certain companies.  
I have to track overdue amounts, which I have dome using SQL.
I have loaded the outstanding amounts and details into a DB grid.  Now I need to be able to use some form of a checkbox or the like within the grid to state whether or not the amount has been paid, and thus remove it from the recordsource (the latter I think I can do ok).
Basically, I need to know the best way to perform the reconcilintion part 9ie - the checkboxes)

Hope someone can help!!!!


0
Comment
Question by:nu2vb
[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 Comments
 
LVL 3

Expert Comment

by:vmano
ID: 1496885
I had to do similar thing in a project which i worked on. but we switched to MSFlexGrid just 'coz it's difficult with DBGrid. and as far as i know both are pretty much same functionality wise.
In MSFlexGrid you have a property called "CellPicture" which you can use to load a checkbox (checked/uncheked) picture depending on the field value. if you are open to this option, let me know.

vmano
0
 
LVL 3

Expert Comment

by:TheAnswerMan
ID: 1496886
I use TrueGridPro.. which which is mad by the same punks who gave you dbGrid.

It has a feature that you can do similar to VManos, except that it doesnt load up a picture.. it is internal and can automatically change on clicking it.

I use the feature of adding a bitmap, though, becasue i like the
ability to put Checks.. or X's or dots.. or whatever in my checkboxes.  

It also has some good unbound features.

If you cant do that.. then Vmanos cellPicture will do it.. i dont know if it will change for you or you have to code for it or not , though.
0
 

Author Comment

by:nu2vb
ID: 1496887
Thanks guys for your help.  I don't have TrueGridPro, so I'll have to give that one a miss (though it sounds good).  I have no idea about how to use the form20.dll, so i'll have to let that one go.

The FlexGrid may be my only option, and if it's worked before, what the heck, I'll give it a go.

If you could vmano, please give me the details on how to proceed.  I'd really appreciate it.

And thanks again all of you for your input - It all helps!!!!!

0
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!

 
LVL 3

Expert Comment

by:vmano
ID: 1496888
nu2vb,
you have to find .bmp of checked and unchecked and then you can load those images in to your MSFlexGrid like this:
(field1 can be a boolean or number)
if data1!field1 = 1 or Yes then
   MSFlexGrid.col = 1
   MSFlexGrid.row = 1
   set MSFlexGrid.cellpicture = LoadPicture("C:\checked.bmp")
else 'the value is zero or no
   MSFlexGrid.col = 1
   MSFlexGrid.row = 1
   set MSFlexGrid.cellpicture = LoadPicture("C:\unchecked.bmp")
endif

you can put the same code in the MSFlexGrid click event.

let me know if you want any other details,
vmano
 

 
0
 

Expert Comment

by:vinoopauls
ID: 1496889
You can try this too
have a listbox containing 2 values 'Yes' and 'No' and keep it invisible
On the buttonclick event for the particular cell make it visible and have the user click the required value into the cell. This will remove the need for all the bmps

0
 

Author Comment

by:nu2vb
ID: 1496890
Thanks for all your help guys!
I'm going to try the above couple of suggestions in my program and hopefully get it working!

I appreciate all of your help..........
0
 
LVL 3

Accepted Solution

by:
BGillham earned 100 total points
ID: 1496891
DBGrid does not support this feature. Now you have two choices.
1. Buy a grid that does support this feature.
2. Place a checkbox on you form and when the column receives focus make the checkbox visible and Move it over the Cell. On LostFocus display True / False or whatever.
0

Featured Post

Independent Software Vendors: 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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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…
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