writing checkbox values to a textbox

mikeco555

Registered User.
Local time
Today, 14:10
Joined
Jan 23, 2004
Messages
22
I am having a slight problem sending the caption of a label to a text box, based on the value of an associated check box.
It puts the value I desire in the text box, but gives me the following error:

Run-time error '2115'
The macro or function set to the BeforeUpdate or ValidationRule for this field is preventing ICU DATABASE (my database name) from saving data in the field.

Here is my code for the check box I am having trouble with(Label37 is the label associated with the checkbox):

Private Sub nosinfec_Click()
If nosinfec.Value = True Then
txtComplications.SetFocus
txtComplications.Text = Label37.Caption
End If
End Sub
 
Code:
Private Sub nosinfec_AfterUpdate()
    If Me.nosinfec Then Me.txtComplications = Me.Label37.Caption
End Sub

So, what was the design decision that made you give a notation to the textbox, name the checkbox something unintelligible, and not to bother naming the label whatsoever? :p
 
thanks for the tip, but how do I set it up so I can use multiple checkboxes and one text area ie. to make a list of the checked boxes in a text area.

with the code you supplied It will overwrite each time i check a checkbox.
 
Wouldn't a multi-select listbox be easier? Also, storing multiple selections in a single field violates first normal form (if you care) but more to the point, is extremely difficult to work with.
 
How do you make a multi-select list box in the first place?
 

Users who are viewing this thread

Back
Top Bottom