scedule text to appear on certain days

anchamal

Registered User.
Local time
Today, 11:20
Joined
Mar 7, 2010
Messages
57
i'm using ms access 2003.
i've got a form that i placed 7 different text messages inside which i already can hide. what i need to do is to unhide them but one every day.
for example:

"monday" text must appear only on monday
"wednesday" text must appear only on wednesday .... and so on

monday is text1
tuesday is text2

can somebody help me with the vba code needed on the on open event?
thanks
 
Hi,

First up to make the code easier, rename your textboxes to txt_Monday, txt_Tuesday . . .

then this code should do what you're looking for:

Code:
Private Sub Form_Load()

    Dim strDay As String
    
    strDay = Format(Date, "DDDD")
    
    Me.Controls("txt_" & strDay).Visible = True
    
End Sub
 
or this

select case weekday(date)
case vbmonday: displaytext = "monday text"
case vbtuesday: displaytext = "tuesday text"
....
end select


personally, i would store the text strings in a table, and read them from there - then you can change the text without having to change code.
 

Users who are viewing this thread

Back
Top Bottom