Days Of Week Selector

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have seven option buttons on my form for each day of the week.

The user can select one or any number of days (this is not in an Option
group where only one option can be selected).

What is the best way to store these options buttons as feilds? In a
seperate table related to the main table? Or in the main table?
 
You need ---

TblMain
MainID
<fields in TblMain>

TblRelatedToMain
RelatedToMainID
DayOfWeek

Your form with the 7 buttons needs to be set up so each time you click a
button, you record the day of the week for the button and then go to a new
record.
 
As you can have multiple days of the week associated with each record you
should store them in a separate table with one column which references the
primary key of the existing table and a DayOfWeek column. The two columns
together should be made the table's composite primary key. You should also
have a DaysOfWeek table with just seven rows. This should be related to the
new table on DayOfWeek abd referential integrity enforced. This ensures that
a non-existent day of week can not be entered into the new table; unlikely, I
know, but good database design covers all possibilities no matter how
unlikely.

As you are showing the days of week on your form with un bound controls
you'd need code in each one's AfterUpdate event procedure which adds or
deleted the relevant row from the new table, depending on whether the option
button is selected or unselected. You'd also need code in the form's Current
event procedure which looks up the related rows in the new table for the
current record and selects the appropriate option buttons.

You could also d it without code simply by having a subform in the main
form. The subform would be based on the new table and liked to the parent
form on the two keys fields. It would be in continuous form view and have
just one control, a combo box which lists all the seven days of the week. To
associate a day with the current record a new row would be added in the
subform simply by selecting a day from the combo box in the subform's blank
new record row. To remove a day you'd delete the row from the subform using
the delete button non the toolbar while the row is selected.

Ken Sheridan
Stafford, England
 
"Steve" <[email protected]> schreef in bericht
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications 'Resource ????
Over 1150 users have come to me from the newsgroups requesting help '1150 users ????
(e-mail address removed)

--
To Steve:
Over 475 users from the newsgroups have visited the website to read what kind of a 'resource' you are... (rapidly increasing..)

To the original poster:

Most people here have a common belief that the newsgroups are for *free exchange of information*.
But Steve is a notorious job hunter in these groups, always trying to sell his services.

Before you intend to do business with him look at:
http://home.tiscali.nl/arracom/whoissteve.html

Arno R
 

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

Back
Top