Adding a "Tip of the Day" feature to a database

Status
Not open for further replies.

MStCyr

New member
Local time
Today, 02:02
Joined
Sep 18, 2003
Messages
333
This sample shows how to add a "Tip of the Day" feature to any database.
 

Attachments

error msg

I got a error msg. Can't find or library. Did I miss something?
 
Please ensure that your References include the DAO library
 
Good stuff!!!
icon14.gif
 
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?


Code:
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
 
First, you want to explicitly refer to a specific library to be safe:

Code:
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.
 
Different, but more fun!!

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.
 

Attachments

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?
 
reeve13 said:
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.
 
Status
Not open for further replies.

Users who are viewing this thread

Back
Top Bottom