PDA

View Full Version : Is it possible based on a checkbox to set blank fields based on a specific criterias?



wedd
10-27-2010, 01:32 AM
I have three organisations on a form that user has to to tick the checkbox. Is it possible based on the tick for each checkbox of the flat rates or specific hiring costs of that organisation to only be inputted in the other fields? If so, how can this be done? Do you have any sample visual basic code?


Thanks:friends:

Imdabaum
10-27-2010, 06:11 AM
I have three organisations on a form that user has to to tick the checkbox. Is it possible based on the tick for each checkbox of the flat rates or specific hiring costs of that organisation to only be inputted in the other fields? If so, how can this be done? Do you have any sample visual basic code?


Thanks:friends:

Yes. Each control has events tied to it. AfterUpdate, BeforeUpdate, Load, Open, MouseOn, etc. For this instance you'd want something on the afterupdate event. One of the checkboxes is ticked so set your values. If the ticks are exclusive use a group box and a select statement based on the group box.


SELECT Case grpBox.Value
Case 1 'CheckBox1 value represents one
'insert values to set
Case 2 'CheckBox2
'make values something else
Case 3 'Checkbox3
'And do it again.
End Select

'if you don't have a group box and the checkboxes are all unrelated
If Me.checkbox1.Checked Then
'set values
Else
'set different values
End if
'repeat as much as necessary for your checkboxes.

wedd
10-27-2010, 06:56 AM
Thanks, this looks good. Hopefully this will work.