Home > Microsoft Access Help > checkbox on form

checkbox on form



hi,



i have a form with checkboxes.



how can i update the values of both the checkboxes and the textfiled in my tables???



what i need is that if i check on the checkboxes, a text box will appear besides it so that the user can type in the comments based on the checkbox he click.

then how can i update the values of both the checkboxes and the textfiled in my tables???



---------------------------------------------------------------



example



the user check the checkbox sports (checkbox) and write in the comments Swimming (textbox).



in my table it will appear under the | Past-time column |

| Sports - Swimming |



thanks!

    
Guest


nono270980





In the attached sample open the frmCheckBox, you will see a record with a check box ticked untick it and you will see that the memo ceases to be visible. When you want it visible tick the box.



Look at the on current event and the after update event, and you will see how it works. It is a bit rough but it works and you can take it from there.



The other form is just a sample that i used for someone who wanted the field customername to change colour when data was entered into it.



This is what I think you wanted, let me know.

HTH,



Regards,

Was this answer helpful ? Yes No   
Guest


oops!!





Forgot the attachment.





Sorry,

Was this answer helpful ? Yes No   
Guest


hi



thanks that is exactly what i want. but mine involved more than one checkbox.



i have attached an file, i hope u could help me with it.





thanks!

Was this answer helpful ? Yes No   
Guest


nono270980,



Maybe I did not make myself clear, you have to enter the code in BOTH on current event of the form and after update of the control (this one you have done). Put your code in the on current event and you will solve your problem.



If you don't know how to access the On Current event, open you form in design view, point to the little black square in the top left hand corner, right click your mouse and select properties.



Just one thing, the design of you database would allow duplicate "CustomerNames" to be entered. I could enter smith, smith, smith harry, smith mary. How would you find the correct "smith". You should never use "reserved" words when you name fields you have called yours "name" you should use say CusName or CustomerName. Also never use date called it StartDate FinishDate even Mydate but never date.



Good Luck,

Was this answer helpful ? Yes No   
Guest


hi, with your help, my checkbox are perfectly done. All thanks to u!



but can i ask u another problem??



i would like to capture the values of the textfield that i have entered into another memo field. i know it sound redundant but becoz i need it for my report as i wish to have memofield in my report instead of checkboxes.



I hope u could help me!



for example.



i enter the fields in the forms as what we have discussed earlier where i can click on the checkbox and the textfield will appear.



eg. in a form (only checkbox and textfield)



Past time:

checkbox | textfield

Indoor sports | Squash

Outdoor sports | Swimming



Base on the data i entered into my form i want it to be capture into the memo field in my report as shown below.



eg. in report format (no checkboxes and textfield only memo field (this is in the same table but not shown in the form format) )



Past time :

indoor sports - squash

outdoor sports - swimming



it may seems blur to u. if any queries, feel free to ask me back. i and hope that u can help me with it.



thanks a million

Was this answer helpful ? Yes No   
Guest


Have a look at the report named:-



rptMemoYesCheckBoxNo



This shows the memo field and not the check box.



What do you want to do when this happens; user tick a box enters information in the memo field, then unticks the box. The user cannot see the memo field BUT the information is still there.



If you want the report to be show the same as the form then you would have to code the report to show the same as the form.





The counting of the YES in the report, it is just something I did for someone else.



Regards

Was this answer helpful ? Yes No   
Guest


oops,





Sorry forgot the attachment.

Was this answer helpful ? Yes No   
Guest


hi,





i have make amendments to your db, i hope u have a backup for yourself.



i have amend the table and add in a new form and a new report named "table 1".



i think this will give a better understanding





thanks

Was this answer helpful ? Yes No   
Guest


Have a look at this, I hope this is what you mean.



If so, then you have to do a little bit of work on the query so that If on of the memo fields is blank it will not leave a space. I would not worry about that at the moment just finish what you started.



Regards,

Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2008 by Infoqu. All rights reserved