View Full Version : Adding a "Tip of the Day" feature to a database


MStCyr
07-19-2006, 08:34 AM
This sample shows how to add a "Tip of the Day" feature to any database.

Joe8915
08-01-2006, 12:06 PM
I got a error msg. Can't find or library. Did I miss something?

MStCyr
08-02-2006, 05:24 AM
Please ensure that your References include the DAO library

MsLady
08-07-2006, 11:58 AM
Good stuff!!! http://www.access-programmers.co.uk/forums/images/icons/icon14.gif

Keith Nichols
08-07-2006, 06:41 PM
Hi,

The db fell over at the Dim MyDB as database line copied below. I'm using A2k on my home PC.

I saw your response to MSLady, but don't know where/how to reference a DAO library. If that is my problem, could you give me a little guidance?


Private Sub Form_Open(Cancel As Integer)
DoCmd.Restore
On Error GoTo Err_Form_Open

' Check to see if Tip of the Day should open.

Dim MyDB As Database

Banana
08-07-2006, 06:45 PM
First, you want to explicitly refer to a specific library to be safe:

Dim MyDB As DAO.Database
Dim MyRs As DAO.Recordset

This help protect you from VBA making assumptions when it shouldn't be.

To check your references:

in VBA editor, click Tools -> References. Ensure you have DAO 3.6 checked.

HTH.

kesam
08-08-2006, 03:23 AM
Not quite the same thing but I added this to the main form on a db we use in our office. Keeps the staff happy (or maybe they're just humouring me!!).

Really simple, just creates a random number on opening then gives you a pop up form showing a record from the fun tbl.

reeve13
08-21-2006, 12:37 PM
I love this feature, but I am having a problem. How do I get it to pop up into a particular form ONLY. I followed your instructions, but upon opening my form, it does not show up. It only shows up when I close my form. What am I doing wrong?

MStCyr
08-22-2006, 05:48 AM
I love this feature, but I am having a problem. How do I get it to pop up into a particular form ONLY. I followed your instructions, but upon opening my form, it does not show up. It only shows up when I close my form. What am I doing wrong?

Good morning

Please check the Form Open event in the frmMainMenu in the example supplied, that where it all happens.