Make a bound option group show a default

M

Monte Grant

If no option choice was made, the default option is not displayed in the
group, unless the option group is unbound. I prefer bound so I can query
for the values without referring to the form.

I set the default for the table column to the option group default, but for
some reason, this does not get applied when a form is opened. Its like the
data only goes one way, from the group to the table. The values only show
in the group if they were entered throught the group.

If this needs to be coded, how might I do it. Thanks.

Nick
 
G

Graham Mandeno

Hi Nick

Do you realise the default value is only applied to new records? Are you
opening the form in data entry mode (ie initially positioned at a new
record) or are you perhaps looking at an existing record where the bound
field's value is actually Null?
 
M

Monte Grant

I created a new record and opened the form with the option group, in add
mode. I also set the bound column default to the option group default.
There are 2 option groups in the form, one bound and another not bound. The
bound group displays nothing while the unbound displays the group default.
The bound group should at least reflect the table column default value,
right? If not, how can I get it to read the column and at least show the
default.


Graham Mandeno said:
Hi Nick

Do you realise the default value is only applied to new records? Are you
opening the form in data entry mode (ie initially positioned at a new
record) or are you perhaps looking at an existing record where the bound
field's value is actually Null?

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Monte Grant said:
If no option choice was made, the default option is not displayed in the
group, unless the option group is unbound. I prefer bound so I can query
for the values without referring to the form.

I set the default for the table column to the option group default, but for
some reason, this does not get applied when a form is opened. Its like the
data only goes one way, from the group to the table. The values only show
in the group if they were entered throught the group.

If this needs to be coded, how might I do it. Thanks.

Nick
 
T

Treebeard

Just a thought:

For the "bound" option group , is the bound column "0" ? If not try
rearranging the row source and making it 0.




Monte Grant said:
I created a new record and opened the form with the option group, in add
mode. I also set the bound column default to the option group default.
There are 2 option groups in the form, one bound and another not bound. The
bound group displays nothing while the unbound displays the group default.
The bound group should at least reflect the table column default value,
right? If not, how can I get it to read the column and at least show the
default.


Graham Mandeno said:
Hi Nick

Do you realise the default value is only applied to new records? Are you
opening the form in data entry mode (ie initially positioned at a new
record) or are you perhaps looking at an existing record where the bound
field's value is actually Null?

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Monte Grant said:
If no option choice was made, the default option is not displayed in the
group, unless the option group is unbound. I prefer bound so I can query
for the values without referring to the form.

I set the default for the table column to the option group default,
but
for
some reason, this does not get applied when a form is opened. Its
like
the
data only goes one way, from the group to the table. The values only show
in the group if they were entered throught the group.

If this needs to be coded, how might I do it. Thanks.

Nick
 
M

Monte Grant

I'll try it, but I had already gone to the table and set all values to 1,
the default. Option group did not read it and change its display. Does it
matter if the field is text or number?



Treebeard said:
Just a thought:

For the "bound" option group , is the bound column "0" ? If not try
rearranging the row source and making it 0.




Monte Grant said:
I created a new record and opened the form with the option group, in add
mode. I also set the bound column default to the option group default.
There are 2 option groups in the form, one bound and another not bound. The
bound group displays nothing while the unbound displays the group default.
The bound group should at least reflect the table column default value,
right? If not, how can I get it to read the column and at least show the
default.


Graham Mandeno said:
Hi Nick

Do you realise the default value is only applied to new records? Are you
opening the form in data entry mode (ie initially positioned at a new
record) or are you perhaps looking at an existing record where the bound
field's value is actually Null?

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

If no option choice was made, the default option is not displayed in the
group, unless the option group is unbound. I prefer bound so I can query
for the values without referring to the form.

I set the default for the table column to the option group default, but
for
some reason, this does not get applied when a form is opened. Its like
the
data only goes one way, from the group to the table. The values
only
show
in the group if they were entered throught the group.

If this needs to be coded, how might I do it. Thanks.

Nick
 
T

Treebeard

Nevermind. I'm thinking of a combo box, not an option group.

Are you sure that the default value (1) corresponds to the value of one of
the options in the group?
the default. Option group did not read it and change its display. Does it
matter if the field is text or number?

No .You should be able to map to either a text or numeric field. .



Monte Grant said:
I created a new record and opened the form with the option group, in add
mode. I also set the bound column default to the option group default.
There are 2 option groups in the form, one bound and another not bound. The
bound group displays nothing while the unbound displays the group default.
The bound group should at least reflect the table column default value,
right? If not, how can I get it to read the column and at least show the
default.


Graham Mandeno said:
Hi Nick

Do you realise the default value is only applied to new records? Are you
opening the form in data entry mode (ie initially positioned at a new
record) or are you perhaps looking at an existing record where the bound
field's value is actually Null?

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Monte Grant said:
If no option choice was made, the default option is not displayed in the
group, unless the option group is unbound. I prefer bound so I can query
for the values without referring to the form.

I set the default for the table column to the option group default,
but
for
some reason, this does not get applied when a form is opened. Its
like
the
data only goes one way, from the group to the table. The values only show
in the group if they were entered throught the group.

If this needs to be coded, how might I do it. Thanks.

Nick
 
G

Graham Mandeno

What happens if you use the form to create a new record but DO NOT select a
value from that option group? Does it end up with the default value?

If the option group contains option buttons/checkboxes, do they appear white
or grey when the form opens? Grey indicates a null value, while all white
would indicate a value that is not one of the options.

Are you sure that one of the option/toggle buttons/checkboxes in the option
group has its OptionValue equal to the default value?

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Monte Grant said:
I created a new record and opened the form with the option group, in add
mode. I also set the bound column default to the option group default.
There are 2 option groups in the form, one bound and another not bound. The
bound group displays nothing while the unbound displays the group default.
The bound group should at least reflect the table column default value,
right? If not, how can I get it to read the column and at least show the
default.


Graham Mandeno said:
Hi Nick

Do you realise the default value is only applied to new records? Are you
opening the form in data entry mode (ie initially positioned at a new
record) or are you perhaps looking at an existing record where the bound
field's value is actually Null?

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Monte Grant said:
If no option choice was made, the default option is not displayed in the
group, unless the option group is unbound. I prefer bound so I can query
for the values without referring to the form.

I set the default for the table column to the option group default,
but
for
some reason, this does not get applied when a form is opened. Its
like
the
data only goes one way, from the group to the table. The values only show
in the group if they were entered throught the group.

If this needs to be coded, how might I do it. Thanks.

Nick
 
M

Monte Grant

Okay, I found it. The subform containing the option group contains records
in a many table that did not yet have a record created. That control would
never be used until a record was created anyway. I don't know why the other
records weren't showing, but they are now. Thanks for helping get the
gears turning.



Graham Mandeno said:
What happens if you use the form to create a new record but DO NOT select a
value from that option group? Does it end up with the default value?

If the option group contains option buttons/checkboxes, do they appear white
or grey when the form opens? Grey indicates a null value, while all white
would indicate a value that is not one of the options.

Are you sure that one of the option/toggle buttons/checkboxes in the option
group has its OptionValue equal to the default value?

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Monte Grant said:
I created a new record and opened the form with the option group, in add
mode. I also set the bound column default to the option group default.
There are 2 option groups in the form, one bound and another not bound. The
bound group displays nothing while the unbound displays the group default.
The bound group should at least reflect the table column default value,
right? If not, how can I get it to read the column and at least show the
default.


Graham Mandeno said:
Hi Nick

Do you realise the default value is only applied to new records? Are you
opening the form in data entry mode (ie initially positioned at a new
record) or are you perhaps looking at an existing record where the bound
field's value is actually Null?

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

If no option choice was made, the default option is not displayed in the
group, unless the option group is unbound. I prefer bound so I can query
for the values without referring to the form.

I set the default for the table column to the option group default, but
for
some reason, this does not get applied when a form is opened. Its like
the
data only goes one way, from the group to the table. The values
only
show
in the group if they were entered throught the group.

If this needs to be coded, how might I do it. Thanks.

Nick
 

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

Similar Threads


Top