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
Solved

Data-Aware Checkbox: ValueUnchecked problem

Posted on 1998-03-03
6
609 Views
Last Modified: 2010-04-04
I am using data-aware check boxes, and I want the boxes to be unchecked if the value in the respective field is NULL, ie nothing there, a blank field, no data. As if no data had been entered yet.

I've tried the following and they don't work:

1. DBCheckBox.ValueUnchecked := ''; (no spaces)

2. DBCheckBox.ValueUnchecked := NULL;

3. DBCheckBox.ValueUnchecked := ' '; (1 space)

Can you help me here?
0
Comment
Question by:jsweby
  • 3
  • 3
6 Comments
 
LVL 8

Expert Comment

by:ZifNab
ID: 1360039
Hi jsweby,

You have to use IsNull

eg. Table1.FieldByName('CheckThis').IsNull

Returns true if field content is empty, otherwise false.
0
 
LVL 4

Author Comment

by:jsweby
ID: 1360040
The ValueChecked and ValueUnchecked properties of DBCheckBox cannot take Boolean values, so how do you suggest I implement your answer? The value on the right-hand side of the property ValueUnchecked has to be of type String, as in my original question above.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1360041
Wow, don't eat my heart out!

What about ....ValueUnchecked := #0

Besides my first answer can be used if nothing else helps or nothing else is possible :

e.g. DBCheckBox.Checked := (Table1.FieldByName('CheckThis').IsNull = False);


Q : What type is the underlying data?

I just want to help, you know.

Regards, Zif.
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 4

Author Comment

by:jsweby
ID: 1360042
Hi ZifNab,

Sorry if you got the impression I was having a go at you, I wasn't!

I've just realised that this component DOES have a Checked value which can be set to True or False. I thought it didn't, which I thought was strange seeing as the standard CheckBox component does. That's why I've been trying to get this ValueUnchecked to work, which only takes a String and not a Boolean value.

Thanks for trying to help, sorry you took my comments the wrong way!
0
 
LVL 4

Author Comment

by:jsweby
ID: 1360043
Zif,

If you submit your answer again, I'll give you the points. I can't see how to do it from a comment
0
 
LVL 8

Accepted Solution

by:
ZifNab earned 50 total points
ID: 1360044
Hi jsweby,

Sorry about my last comment, had a bad day and couldn't take much at that time ...

What about ....ValueUnchecked := #0

or DBCheckBox.Checked := (Table1.FieldByName('CheckThis').IsNull = False);

Regards, Zif.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Intraweb submit form as a POST request 4 322
Syntax Check Delphi Seattle IOS app without MAC ? 1 104
Print Graphic and Text to Epson TM-T88v 12 367
Multiple image collision 13 80
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

791 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