Help w/ check box that can add additional text to field, not just replace text.

chapmajm

Registered User.
Local time
Today, 09:14
Joined
Mar 22, 2007
Messages
28
Hello,

I need help adding text to a field by using a check box. Not just replacing the current text with the text I coded in.

Code:
Private Sub CheckBoxName_AfterUpdate()

If Me![CheckBoxName].Value = False Then Me![FieldName] = Null
If Me![CheckBoxName].Value = True Then Me![FieldName] = "text"

DoCmd.RunCommand acCmdRefresh

End Sub

I would like to click a checkbox and it would input text into my field. Then if I click another checkbox, it will add the addtional text right after my previous text.

Your help would be greatly appreciated. Thanks! -Jenny ;)
 
Change your code to this (although I am suspicious why you would need to do this):

Code:
Private Sub CheckBoxName_AfterUpdate()

If Me!CheckBoxName Then 
   Me!FieldName = Me!FieldName & "text"
Else
   Me![FieldName] = Null
End If

End Sub
 
It works! Woo Hoo! Brilliant! Thank you!

I need to do this because I've created a database simply to replace a medical transcription service. The doctor clicks a check box in my "VisitPlan" memo field. So, if he has multiple plans for the patient... he needs to check multiple boxes. I.e. Plan is ... sleep study (one plan) follow up with me in two weeks (second plan) sleep diary (third plan) etc.

I know, I know... I could have done a table with a plan field and used a combo box, but then I couldn't get my report to look right. It needs to be letter format, not a report for multiple patients.

I do appreciate your time. Thank you Bob!
 

Users who are viewing this thread

Back
Top Bottom