Tony,
There are two ways to do this:
1. Binding the Option Box to a field in the form's RecordSource:
With this option, the Option Box must be bound to a field that is in the
table/query to which the form is bound. For example, if the form is bound to
tblMyForm, then the Option Box can be bound to any field in tblMyTable that
returns a Boolean value.
To bind a form to a specific table/query:
a). Open the form in design view.
b). Open the Properties dialog (right-click and select Properties from
teh context menu).
c). Select the Data tab.
d). Select the appropriate table/query from the RecordSource drop-down.
That's it!
To bind a control to a specific field at the time you place it on the form,
do the following:
a). From the View menu, select Field List. The Field List is displayed.
b). On the Toolbox, click the type of control you want to add (in your
case, an Option Box).
c). In the Field List, drag the appropriate field to the form. That's
it!
To bind a control to a specific field after it has been placed on the form,
do the following:
a). Click the appropriate control.
b). If necessary, right-click and select Properties from the context
menu (to display the Properties dialog).
c). Select the Data tab.
d). Select the appropriate field from the ControlSource drop-down.
That's it!
2. Binding the Option Box to a field in an unrelated table:
With this option, the Option Box can be bound to any field in any table (as
long as that field returns a Boolean data type).
To bind a control to an external field:
a). Select the appropriate control.
b). If necessary, right-click and select Properties from the context
menu (to display the Properties dialog).
c). Select the Data tab.
d). Click inside the ControlSource field (but don't drop-down its list).
e). Enter the following:
=DLookup("myField", "myTable", "somecriteria = met")
*** Naturally, change the above values to suit your situation.
That's it!
Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html
Tony said:
G'day All,
I have been having heaps of trouble trying to associate an option box with a field in a table.
Not sure whyI am unable to achieve this as all the tutorials I have seen
have a very simple description on adding the field.