Change Numbers to Day

colmtourque

Registered User.
Local time
Today, 02:10
Joined
Sep 26, 2002
Messages
83
I have a form that has numeric values for Days as this
0=Everyday
2-6 Mon-Fri respectivly
8-M, W, F
9-T,Th

The Combo Box is done off a query that has the numbers tied to the days but when you select it returns the numeric value

While that is actually what I want I want the Names of the Days to be shown in the Form view i.e. Monday for 2 etc...

How is this done, I tried and iif statement but all it returns is error and I tried to format it FORMAT([weekday],"dddd") that did not work either.
 
I'm having a problem understanding your problem...

The table you show indicates that there are 4 different categories:

0 Everyday
2-6 Mon-Fri
8 Mon/Wed/Fri
9 Tue/Thu

But you want the form to show the value for each day?
But Mon/Wed/Fri has a value - 8, while having a value of 6 if in the 2-6 option.

Very confusing....

Can you explain this a little more?
 
sorry here is the table fully explained

Table Field Field Represents
0 Classes Held Everyday
2 Classes Held Monday
3 Classes Held Tuesday
4 Classes Held Wednesday
5 Classes Held Thursday
6 Classes Held Friday
8 Classes Held Monday, Wednesday and Friday
9 Classes Held Tuesday and Thursday


I have kindof cheated my way into getting this to work, but I am wondering if there is an easier way to set it up.

My cheat is to use a multiple select box bound to a table with two fields one for either side of the above.
 
If your combo is working for you, but not displaying the "words", you could set your column widths to correct the problem.

ie: Your numbers and appropriate day display in the drop list, but the number only displays when selected.


View the properties of the combo, and set the "Column widths" property to:

0;3;3 etc

Note: the 0 indicates to hide the first column, thus displaying the associated words.

HTH

Brad.
 
Tried that and strangely it chose to input the word not numbers into the table
so I set it to .05,1,1

That works allright
But I would rather have a text box with the word instead of the number
is that possible
 
Hi again,

What about a different tack?

Have 7 unbound tickboxes called 'Mon' thru 'Sat' and 'All'

These would be displayed in a row on the form and each one labelled according to the day it represents.

The user ticks the day(s) of the course and then on saving, usually when the form is closed, the code runs and does something like -

Dim CourseDays As String
If Mon Then CourseDays="Mon"

If Tue Then
If IsNull(CourseDays) Then
CourseDays="Tue"
Else
CourseDays=CourseDays & "/Tue"
End If

If Wed Then
If IsNull(CourseDays) Then
CourseDays="Wed"
Else
CourseDays=CourseDays & "/Wed"
End If


carry on like this for all the days and you will end up with a string holding all the course days selected like -
CourseDays="Mon/Wed/Fri"

Make sure that if the user selects 'All' that the code for the days is ignored and CourseDays made to read 'Everyday'

Also make sure that if all the days are selected individually, then the the user is queried, or the CourseDays string is changed to 'Everyday'.

Just another idea....

Dave E
 
and a very good one. Thanks, I'll try that, I am also playing with if then scenarios and text boxes on reports, but this should be awesome for the report. Thanks!
 

Users who are viewing this thread

Back
Top Bottom