Setting Defaults for a checkbox

R

rico

Hi All,

I have a checkbox which is displayed in a continuous form. What i need to do
is set different DEFAULT values of the check box for each record. Is this
possible? i can't seem to think of a way to do it.

TIA

Rico
 
T

Tom van Stiphout

On Tue, 29 Jan 2008 05:21:00 -0800, rico

Your only option is to have that checkbox be bound, and set the
default value in the underlying records.
Note that unless you REALLY know what you are doing, yes/no fields
should always have a default value.

-Tom.
 
P

Pat Hartman

What determines the default value? In the form's BeforeUpdate event, you
can check the field for null and if it is null, you can provide a default
based on something else.

If IsNull(me.somefield) Then
If me.someotherfield = "x" Then
me.somefield = "val1"
Else
me.somefield = "val2"
End If
End If
 
R

rico

I dont understand what your saying - if i bind the textbox then this changes
the default value. I'll try and explain again. These are items that are
optional extras for products we sell. Some should be included as default,
some not. This is this info in the table

productID includebyDefault
12 yes
145 no
32 yes

So when the product these options are for is selected in the order, a list
pops up with relevant extras. Next to each i have a tick box which decides
whether the option is to be included in the order, the default of which needs
to be decided by the infomation above.

Hope this is clearer

Thanks

Rico
 

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