Changing Yes/No CheckBox Value

Not in Nome, put it under unemployed.

If you put True in as a criteria for Nome, Access will look for anyone with a nome of "True" (you may have noticed it automatically putting quotes in). The reason for this is because Nome is a text field - this relates to the data type mismatch problem you had earlier.
 
Yes, I noticed that and I hadn't realized why.
Well, it doesn't work anyway.
The value of the checkbox for 'Desempregados' is -1...
Shouldn't be right?
I already select that option 'yes/no', but the value still -1
 
So I need to add another query? one for those who are not unemployed?
 
-1 is true, 0 is false in Access. Criteria-wise you can either use -1 or 0, or true/false, same thing.
 
And no - that was just to illustrate the difference between true and false.
 
Cool glad we got it working then. Enjoy the weekend! Are you in Portugal then?
 
I work this weekend :S
Yeah, I´m Portuguese.
Where are you from? Which part of Uk?

Look. .can you try to do this? I'm not really good at MS Access :S
Well, but I have to send the file by mail. .
 
I think you'll be OK - just have a read through the posts again.

Northamptonshire is pretty much in the middle of England, sunny for a change here! My wife and I are coming out to Portugal in a couple of months
 
;D I hope so. . My head is spinning :P

So, Where do you go?
Algarve?
 
Not sure yet, somewhere sunny though (that doesn't narrow it down much I know)
 
Unfortunatly. ..I can't . . :S
Remember what I asked you?
Change the value to text... Is that possible?
 
I suppose you could but my question was why?

The function cstr() changes stuff to text, but in this case you'd only ever end up with the strings "-1" if true and "0" if false. The only way I can think of changing it would be to put something like this in the on click:
Code:
Dim Yesno as string
 
If checkbox.value=true then
Yesno="Yes"
Else
Yesno="No"
End If

But you might as well not bother and just use the actual value of the checkbox.
 
I am already bothering... :(
I can't do it with the default value. I did what you told
me to do
Maybe I need to change something on search macros. .:confused:
 
If you want to display the text "Yes" "No" instead of -1 or 0 you can change the field from a checkbox to textbox and in the format property put:

;"Yes";"No"

JR
 
I'm confused too.

So you want to be able to search for people that are unemployed, right? It's in the database I attached last week.

I'm not sure what you mean about macros or default values??

JR, why would you change it to a textbox when the OP wants a checkbox?
 
Value, not field type clever chap :)

I think the OP just wasn't clear on the whole -1=true, 0=false thing.

Tgei - have you had a proper look at the database I uploaded last week? I'm pretty sure it allows you to do what you need to
 
Well I did a macro, to search people on my cantact list. By now, I can search people by name, etc; But what I want to do now is search all people who are unemployed, I mean, when I write 'unemployed' on the searchbox, all the unemployed people shows up on my contact list. . Did I make my self clear?


'use the default values' I mean 'use the actual values'
 

Users who are viewing this thread

Back
Top Bottom