Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to enlarge the Yes/No check BOX 2

Status
Not open for further replies.

knuckelhead

Technical User
Aug 8, 2002
228
US
I have a Yes/no field on my form. The check box is extremely small. I size stays the same when I try dragging the edges.

How can I make the checkbox larger?
 
Roll your own.

blnTF is the boolean field

Format a textbox as "wingding". Control:
=IIf([blnTF],Chr(254),"")
or simply
IIf([blnTF],"X","")

Event
Private Sub txtBxMyCheck_Click()
Me.blnTF = Not Me.blnTF
End Sub

Make it any size you want.
 
MajP: i am not sure of something.
1 - I have a field called FormulaDONE in my tblQuoteMain.

2 - On my frmQuoteMain, I have the new text field on the NAME line called txtBxMyCheck as you wanted me to.

3 - On the Control line, I put =IIf([blnTF],Chr(254),"") as you said. I do not know what you mean blnTF but maybe i need to substitute my field name somewhere here??

4 - When you said Event, I assume you mean the ON Click line. If so, I put:

Private Sub txtBxMyCheck_Click()
Me.blnTF = Not Me.blnTF
End Sub

5 - when i go back and run the Form, the text field shows #Name?

6 - i assume when we correct my misunderstandings, i will have some sort of checkbox?

Thanks for taking the time to tell me what to do next. I numbered my steps to avoid confusion.

regards
Knucklehead
 
blnTF is the boolean (yes/no) field I used.
so
=IIf([yourTrueFalseFieldGoesHere],Chr(254),"")

If you format this as wingdings it actually makes a graphic checkbox. Or you can simply do
IIf([yourTrueFalseFieldGoesHere],"X","")
which will put an "X" if you format it something else

In the event tab of the property form. Click on the three dots, and select "code builder"

You got this
#Name?
because you do not have a true/false field named "blnTF".
 
MajP: sorry to be dumb, but where is that wingding thing. I thought you were making it up. I looked in the toolbox.

knucklehead
 
However, as the article points out WingDings may not be supported in the future so it is not the most portable of solutions. I usually just make a Box with an X, and add some conditional formatting to change the background and font color.
 
Here's another way faq702-2255.

In addition to the code mentioned by mstrmage1768, you'll probably need similar code in the forms on current (to set which of the boxes to be visible), and some code toggling the field in the recordsource.

Roy-Vidar
 
Roy: I almost hjave the FAQ702-2255 working. However, I get -1 for the checked field records and 0 for the unchecked. I guess that means true and false.

My table has the field as a Yes/NO field. However, the FAQ702 said to use text box.

Any ideas?
Knucklehead
 
While waiting, i played around. In the text box named chkUnchecked, i went to the Format line picked the Yes/No condition.

I went back into the form. it shows YES for the checked FormulaDone field and NO for the opposite. At first, this sounded great.

But if i tried to click into the YES answer and change it to NO, i saw a -1. I did not want to change -1 to 0 manually but still use the checkbox type of box.

So maybe i am missing another step, in order to have a bigger checkbox yet allow me to just click in this box to make a yes or no answer?
thanks
 
Knucklehead,
Roy knows a lot more about Access than I do, but I just can not see any utility in that approach.
1. It can not be used on a continous form
2. Requires two controls
3. Has no "Click" utility
4. As posted it does not make sense

The post says to lock the control, but trap the After update event. I might be misreading it, but it just does not make sense to me.

If you want an X, this works fine.

=IIf([yourTrueFalseFieldGoesHere],"X","")

Private Sub txtBxMyCheck_Click()
Me.blnTF = Not Me.blnTF
End Sub

1. It can be used on a continous form
2. Requires one control
3. You can click it just like a checkbox

However, I was thinking continous form. On a single form there is a better way. Make a command button, and there is an Check Marrk image that you can put on the command button. Surround the cmd button by a rectangle and fill it in white. Ensure that you send the rectangle to the back, and the cmd button is in the front. Here is the code.

Private Sub Command10_Click()
Me.blnTF = Not Me.blnTF
Command10.Transparent = Not (Me.blnTF)
End Sub

1. Can not be used on a continous form
2. Has click capability
3. Provides a nice graphic check.
4. One control and simple code.
 
Oops, Forgot. On the forms current event you would need

Private Sub Form_Current()
Command10.Transparent = Not (Me.blnTF)
End Sub
 
yes. it does seem daunting. i may just stay with the Access small checkbox. when i get time, i may try the last idea.

thanks all.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top