Tips Of The Day

Z

zyus

How to put in "Tips Of The Day" or "Word Of the day" kind of thing in Access
Form .

Tips/Word info can be maintained in a table and sys will auto select it
randomly when opened by user.

Thanks
 
S

scubadiver

For what reason are you proposing to so this and what would users get out of
it?
 
F

Fred Boer

Dear zyus:

I have included a "Joke of the Day" in my small library application; it
displays a randomly chosen joke on the main screen. The joke changes each
time you open the application. You add "jokes" or "quotes" to a table.

In the Open event of the form, I have the following code:

Dim lngQuoteCount As Long
lngQuoteCount = DCount("*", "tblQuotes")
Randomize
Me.txtQuote = DLookup("Quote", "tblQuotes", "[QuoteID]=" & _
Int((lngQuoteCount * Rnd) + 1))

This uses a simple table with an autonumber ID and a text field to hold the
joke.

You can see it in action by downloading either of the library applications
available at the link in my sig.

HTH
 
J

John W. Vinson

How to put in "Tips Of The Day" or "Word Of the day" kind of thing in Access
Form .

Tips/Word info can be maintained in a table and sys will auto select it
randomly when opened by user.

Thanks

You can put in a table of quotes, and base a little popup form on a Query such
as

SELECT TOP 1
FROM [CoolQuotes] ORDER BY RandNum(
);

where RandNum is a function:


Public Function RndNum(vIgnore As Variant) As Double
Static bRnd As Boolean
If Not bRnd Then
'Initialize the random number generator once only
bRnd = True
Randomize
End If
RndNum = Rnd()
End Function


John W. Vinson [MVP]
 
Z

zyus

Well, my first reason is to learn more about access capabilities beside
providing my access user with some value info / special quotes or even to put
a smile on my user face with joke of the day as suggested by Fred.
 
Z

zyus

Hi Fred,

I've downloaded the library program and it look wonderful. I'm new in access
and wanted to know how you create a main form with a drop down menu list.

TQ

Fred Boer said:
Dear zyus:

I have included a "Joke of the Day" in my small library application; it
displays a randomly chosen joke on the main screen. The joke changes each
time you open the application. You add "jokes" or "quotes" to a table.

In the Open event of the form, I have the following code:

Dim lngQuoteCount As Long
lngQuoteCount = DCount("*", "tblQuotes")
Randomize
Me.txtQuote = DLookup("Quote", "tblQuotes", "[QuoteID]=" & _
Int((lngQuoteCount * Rnd) + 1))

This uses a simple table with an autonumber ID and a text field to hold the
joke.

You can see it in action by downloading either of the library applications
available at the link in my sig.

HTH
--
Fred Boer - Amateur Access Enthusiast
Interests: Library software / Z39.50 / Web Services
Freeware Small Library Application available here:
http://www3.sympatico.ca/lornarourke/

zyus said:
How to put in "Tips Of The Day" or "Word Of the day" kind of thing in
Access
Form .

Tips/Word info can be maintained in a table and sys will auto select it
randomly when opened by user.

Thanks
 
Top