By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,400 Members | 953 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,400 IT Pros & Developers. It's quick & easy.

Splash Screen Question

P: 14
My current dbase has a splash screen on start up with a time interval of 5000. After it closes the vb code then opens my main form.
Question: I would like to add text to my splash screen that says good morning, good afternnon, good evening depending on the time of the day my dbase is opened. for isntance, if user opens at 6:00AM, it would say good morning, but if the dbase was opened at 6:00PM, it would say good evening.
Question 2: I would also like for it to say things like, today is pearl harbor day on 7 Dec, or happy halloween on 30 October. Any help would be appreciated.
Dec 9 '06 #1
Share this Question
Share on Google+
5 Replies


missinglinq
Expert 2.5K+
P: 3,532
This will take care of the first part of your problem:

http://www.databasedev.co.uk/welcome_message.html

As to the holidays, you'll need a table listing dates and holiday names, and have the form open event check the current date against the dates in the holiday table and display the appropriate holiday name. You might even have a generic display if no holiday is found, like "Have a great day!"
Dec 9 '06 #2

ADezii
Expert 5K+
P: 8,669
My current dbase has a splash screen on start up with a time interval of 5000. After it closes the vb code then opens my main form.
Question: I would like to add text to my splash screen that says good morning, good afternnon, good evening depending on the time of the day my dbase is opened. for isntance, if user opens at 6:00AM, it would say good morning, but if the dbase was opened at 6:00PM, it would say good evening.
Question 2: I would also like for it to say things like, today is pearl harbor day on 7 Dec, or happy halloween on 30 October. Any help would be appreciated.
'This should work for the 1st question, as far as the 2nd one, missingling
'already gave you the answer

'Make adjustments to code where needed
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2. If Time >= #8:00:00 AM# And Time < #12:00:00 PM# Then
  3.   Me![lblStatus].Caption = "Good Morning"
  4. ElseIf Time >= #12:00:00 PM# And Time < #5:00:00 PM# Then
  5.   Me![lblStatus].Caption = "Good Afternoon"
  6. ElseIf Time >= #5:00:00 PM# And Time < #9:00:00 PM# Then
  7.   Me![lblStatus].Caption = "Good Evening"
  8. Else
  9.   Me![lblStatus].Caption = "Hello Everyopne"
  10. End If
  11. End Sub
Dec 9 '06 #3

NeoPa
Expert Mod 15k+
P: 31,661
Excuse me for offering 'improvements' here.
I'd like to encourage the use of 'Select Case' statement for situations such as this.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2.     Select Case Time()
  3.     Case Is < #12:00:00 PM#
  4.         Me.lblStatus.Caption = "Good Morning"
  5.     Case #12:00:01 PM# To #5:59:59 PM#
  6.         Me.lblStatus.Caption = "Good Afternoon"
  7.     Case Else
  8.         Me.lblStatus.Caption = "Good Evening"
  9.     End Select
  10. End Sub
Dec 10 '06 #4

missinglinq
Expert 2.5K+
P: 3,532
I agree with NeoPa,with more than two choices, the Select Case structure makes it much easier in tracking what's going on, especially when the code is revisited down the road.
Dec 10 '06 #5

Expert 5K+
P: 8,434
I agree with NeoPa,with more than two choices, the Select Case structure makes it much easier in tracking what's going on, especially when the code is revisited down the road.
I noticed years ago, our mainframe system has something similar, and if you log on late at night you get something like "Good grief! What are you doing here?". :)
Dec 10 '06 #6

Post your reply

Sign in to post your reply or Sign up for a free account.