Validation rule vs default value

D

Dan

I have a form that placed vaules in a table 1-5 by selecting a check box. I
have a default vaule of 0 for the fields. There is a validaton rule stating
it must be >0 and gives a message that an answer must be given (active check
box). Is it possible using a validation rule to change the 0 to say 3 on the
new record if the question is skipped?

I tried defaulting to 3 but I do not want have the check box pre checked. Or
is this more a form issue? If so then how do I default a response without
"prompting" btw yes this is a survey I am working on Thanks in advance. CHEERS
 
T

tina

Is it possible using a validation rule to change the 0 to say 3 on the
new record if the question is skipped?

yes, i would handle this at the form level. you can use code in the form's
BeforeUpdate event to check the control on new records only, and change 0
values to 3. i assume you're using an option group with checkboxes on the
form, so the code would be something like

Private Sub Form_BeforeUpdate(Cancel As Integer)

If Me.NewRecord And Me!OptionGroupName = 0 Then
Me!OptionGroupName = 3
End If

End Sub

hth


Dan said:
I have a form that placed vaules in a table 1-5 by selecting a check box. I
have a default vaule of 0 for the fields. There is a validaton rule stating
it must be >0 and gives a message that an answer must be given (active check
box). Is it possible using a validation rule to change the 0 to say 3 on the
new record if the question is skipped?

I tried defaulting to 3 but I do not want have the check box pre checked. Or
is this more a form issue? If so then how do I default a response without
"prompting" btw yes this is a survey I am working on Thanks in advance.
CHEERS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top