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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formating the Checkbox 2

Status
Not open for further replies.

khwaja

Technical User
Aug 27, 2001
431
AU
Is there any way one can change the size of the checkbox and be able to remove the square border around it? I merely need to show a check mark in bigger size and without any border. I tried changing the properties but no luck. Hopoe someone can help.

Cheers
 
Unless I am mistaken, there is no way to change the checkbox size and border properties. I have read through many Access programming books and I distinctly remember at least one of them saying that if you needed to change the properties (ie size and look) of a check box, you would have to create them your self....Here has been my solution:

Create a text box and set the font size to that which you want. Place one x in this box (ie your check will now be an x but this is usually acceptable to everyone). Once you have it all right, name it something like txtChecked.

Copy this text box and remove the x. Name this box txtUnchecked.

In the OnClick property of txtChecked, put the following:
Me![txtChecked].Visible = False
Me![txtUnchecked].Visible = True

In the OnClick for txtUnchecked, simply change the trues and falses around.

The last piece of the puzzle is that you have to check which box is visible whenever you need to use this....

Seems like a lot of work, but once you have the first one done, it comes along pretty easily. I have an example database with this inn it if you like....just send an email to the address in my profile and I will forward it to you. Good luck and let me know if I can help anymore. It's not important that someone else can do in one step what it took you ten to do...the important thing is that you found a solution. [spin]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
 
Thanks Robert. I have sent you an email as I was having trouble in assigning the code to On Click property.

Regards


AK
 
Sorry, I should have indicated that I am creating these checkboxes in a report and that might be the reason for not seeing the On Click propetry. I am trying to show in my report all those records which have been updated in a given week for user's convenience. I created a yes/no flag to achieve this. But if this solution is not applicable for logical fields in reports, I can change the field to something different.

Cheers
 
In a report it is not a problem either.....

Make sure the field in on the report, but is hidden. Make the checkboxes similar to what I already described. Set the Visible property of box the boxes to no. Then in the OnFormat event of the Details section use the following:

If Me![name of yes/no field] = True Then
Me![txtChecked].Visible = True
Me![txtUnchecked].Visible = False
ElseIf Me![name of yes/no field] = False Then
Me![txtChecked].Visible = False
Me![txtUnchecked].Visible = True
End If

This will square you away. Again, I can send you an example if you let. Just let me know. It's not important that someone else can do in one step what it took you ten to do...the important thing is that you found a solution. [spin]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
 
khwaja:

Another approach, if your form has sufficient space is to use an option group with the values True/False, Yes/No.

When you create the option group, set the value of the true option to -1 and the value of the false option to 0.

Bind the option group to your check box. When the user clicks on True the box will be checked; if the user clicks on False, the box will be unchecked.

On reports, if they are based on queries, you can set the display of the check box to text. Open the properties for the query (making sure the check box field is selected); on the lookup tab set the Display Control to Text Box; on the General Tab, set the Format to your choice of: Yes/No, True/False, On/Off.

Alternatively, you could use an immediate if (IIF) to test the value of the check box and create your own text display.

Personally, I hate check boxes on forms and reports. The are seldom intuitively obvious to the user. Using option groups on the forms and text displays on the reports is, to me, a more elegant approach.

Hope that helps. Larry De Laruelle
ldelaruelle@familychildrenscenter.org

 
Thank you for the feedback that heped a lot. I have a slightly different issue now. If you are using the default check boxes and choose to 'analyze the report' with Excel (an option you have in print preview screen), the whole report is transformed into spreadsheet or MS word document but for some strange reasons, check boxes don't get transferred into either of these format. Is there someting pereventing this to happen or is it a default feature of MS Access.Using the solution provided by Robert, I can get the check box across but not the value. But personally I would like to to have the ability to transfer my check boxes across without any manipulation.

Any insights?

Cheers
 
Kwaja:

If you use Analyze with Excel on a query result, the check boxes are converted to True/False.

But you are right, for some reason they do not carry over if you use Analyze with Excel on a report. Don't have a clue why that is.

Larry De Laruelle
ldelaruelle@familychildrenscenter.org

 
Thanks. Let us see if simeone else comes up with some ideas.

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top