[Where Is My Cursor] Function (1 Viewer)

Randomblink

The Irreverent Reverend
Local time
Today, 05:13
Joined
Jul 23, 2001
Messages
279
I am building a popup menu for a form in my database.
What I would like to do, is...

When a user moves the cursor into a date field, I would like to right-click and drop the current date into that field...

________________________________________________
Public Function DropDate(ctl as Control)
On Error Goto Err_DropDate

ctl.Value = Now()

Exit_DropDate:
Exit Function

Err_DropDate:
Msgbox Err.Description
Resume Exit_DropDate

End Function
________________________________________________

Then, I add the Function DropDate to the Popup Menu...

What am I doing wrong...?
 

Travis

Registered User.
Local time
Today, 03:13
Joined
Dec 17, 1999
Messages
1,332
Have you run this in Debug mode to make sure that ctl=the control you expect?

If you have and it does not seem to be set then look at how you are passing the control or take out the ctl parameter and set ctl=Screen.ActiveControl.


Public Function DropDate(ctl as Control)
On Error Goto Err_DropDate

ctl.Value = Now()

Exit_DropDate:
Exit Function

Err_DropDate:
Msgbox Err.Description
Resume Exit_DropDate

End Function
 

Users who are viewing this thread

Top Bottom