Opening a Form with a label (1 Viewer)

L'apprentis

Redcifer
Local time
Today, 07:39
Joined
Jun 22, 2005
Messages
177
Hi everybody, I am trying to personalised the way Access looks and in this specific case I am trying to open a form with a label:

I: I have added a "space" on the hyperlink address property which is changing the mouse pointer to a "pointing finger" when the pointer is moved over the label,

II: I have added the following code on the move event of the label to highlight the label when the pointer is on the label:
Code:
Private Sub Option2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Option2.FontBold = True
End Sub

III: I have also added the code below on the click event of the label in order to open the form and change the pointer to an hourglass on loading time as the form can take up to 10 sec to open.
Code:
Private Sub Option2_Click()
    DoCmd.Hourglass True 'Changes pointer to an hourglass
    Dim stDocName As String
    stDocName = "FrmSearchAssembly"
    DoCmd.OpenForm stDocName
    'DoCmd.Hourglass false  'Resets it to the arrow pointer
End Sub

Unfortunately the 3rd step is not working, the hourglass only appears after the form is loaded. Is anybody has any idea why and what should be done to get the hourglass to appear when the label is clicked until the form is fully loaded?
 

supercharge

Registered User.
Local time
Today, 07:39
Joined
Jun 10, 2005
Messages
215
Code:
Private Sub Option2_Click()
    DoCmd.Hourglass True 'Changes pointer to an hourglass
    [COLOR="Blue"]DoEvents[/COLOR]
    Dim stDocName As String
    stDocName = "FrmSearchAssembly"
    DoCmd.OpenForm stDocName
    [COLOR="Blue"]DoEvents[/COLOR]
    [COLOR="blue"]DoCmd.Hourglass False  [/COLOR]'Resets it to the arrow pointer
End Sub
 

L'apprentis

Redcifer
Local time
Today, 07:39
Joined
Jun 22, 2005
Messages
177
Hey, Supercharge, thanks for your reply. Unfortunately, the changes don't seem to do anything, the pointer doesn't show the hourglass. I don't understand why?
 

supercharge

Registered User.
Local time
Today, 07:39
Joined
Jun 10, 2005
Messages
215
Now try this -

Code:
Private Sub Option2_Click()
[COLOR="Blue"]    'DoCmd.Hourglass True 'Changes pointer to an hourglass
    Screen.Mousepointer = 11 ' 0 is normal
    DoEvents[/COLOR]
    Dim stDocName As String
    stDocName = "FrmSearchAssembly"
    DoCmd.OpenForm stDocName
    'DoCmd.Hourglass false  'Resets it to the arrow pointer
End Sub
 

L'apprentis

Redcifer
Local time
Today, 07:39
Joined
Jun 22, 2005
Messages
177
Thanks supercharge, still no luck though. This is confusing me, if I try to open the form with a command button the hourglass is working fine.
 

supercharge

Registered User.
Local time
Today, 07:39
Joined
Jun 10, 2005
Messages
215
L'apprentis said:
Thanks supercharge, still no luck though. This is confusing me, if I try to open the form with a command button the hourglass is working fine.

I'm not sure what you mean by "working fine".

As I'm understanding of what you're trying to accomplish is that you want to display an hourglass, then launch the Search form. When the search is done, change the mousepointer back to normal. At least that's the logic.

The original code you have turns on the hourglass and then back to normal after the search form opens, not after the search is completed. But since you've commented out the second mousepointer statement, the hourglass stays on even after the search form is loaded.

If it is indeed my logic is right, you may want to put the second mousepointer statement (turn back to normal) in your search form's code, after the searching process.

Agree?
 

L'apprentis

Redcifer
Local time
Today, 07:39
Joined
Jun 22, 2005
Messages
177
Cheers Supercharge, basically the form that I want to open is based on a very large query hence the 5 to 10 sec time needed to load and open the form. I have commented out the last part of the code just to see if the "cmd.hourglass true "was working at all because I was getting no changes, when the last line is commented out the pointer change to the hourglass only when the form is fully loaded. What I'd like to do is to see the hourglass pointer when the label is clicked until the form is fully loaded.

I'm not sure what you mean by "working fine".

By "working fine", I mean that if I open the same form with the click event of a command button without worrying about the pointer the hourglass appears during the loading of the form which is what I am trying to achieve.
 

supercharge

Registered User.
Local time
Today, 07:39
Joined
Jun 10, 2005
Messages
215
Is it possible to strip off all the data and attach it here?
 

L'apprentis

Redcifer
Local time
Today, 07:39
Joined
Jun 22, 2005
Messages
177
Thanks supercharge, I am not sure I can because the database is already up and running (splitted and secure), and there is a very large amount of data that my company wouldn't allow to go on the net...I don't think there is anything I can do about it just know, i am going to see if I can make up a similar example though.
 

supercharge

Registered User.
Local time
Today, 07:39
Joined
Jun 10, 2005
Messages
215
L'apprentis said:
Thanks supercharge, I am not sure I can because the database is already up and running (splitted and secure), and there is a very large amount of data that my company wouldn't allow to go on the net...I don't think there is anything I can do about it just know, i am going to see if I can make up a similar example though.

Whenever you're ready, just PM me of it if you refer not to go public.
 

Users who are viewing this thread

Top Bottom