Option Button Question

N

Nimish

Hello,

I am designing a simple form to acquire a data. I have following table for
which I am designing a form.

Table Name: tblSecurities

Market: Text
Security: Text
SecurityDescription: Text

The market column can have values CAN or US only and I would like to have
option buttons for this column. The problem is the value of the option button
can be numeric and I have values as Text. Is it possible to map option button
to a column of a table having text values.

Nimish
 
T

Tom Wickerath

Hi Nimish,

You have two alternatives:

1.) Use a Value List that includes the following properties:

Display Control: Combo Box
Row Source Type: Value List
Row Source: 1;US;2;CAN or 1;CAN;2;US, whichever is applicable
Bound Column: 1
Column Count: 2
Column Widths: 0";0.5"


2.) Create a separate table of Countries linked 1:M with your main table.

...and I would like to have option buttons for this column.

An option group can be more problematic, because it is going to be up to you
to maintain the correct values for each option button, such that they match
the values in your value list or associated table. A better option, in my
opinion, is to use a combo box. In fact, with a combo box, a separate lookup
table of Countries could include just one text field with the values of US or
CAN. That way, you would store these actual values in the foreign key field,
which would make any resulting queries easier to deal with.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________
 
D

Duane Hookom

If you don't want to create a small lookup table with a numeric primary key,
you can bind a locked text box to Market field. Then use code in the After
Update event of your Option Group like:

Me.txtMarket = Choose(Me.optgrpMarket, "CAN", "US")

This assumes option values of 1 for CAN and 2 fro US.
 

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