Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 31st, 2003, 04:53 AM
Authorized User
 
Join Date: Sep 2003
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default cursor; onload, mail or print multiple reports

hi. :D
1. i would like to know how i can change the cursor to hand shape when it is on a label(which i'm using as a button, bcos i want the button to be color). and also to change the cursor to hourglass when i'm waiting for data to be imported to my database.

2. i would like to know how to load a function that resets my check boxes when my form is open. my checkboxes are grey when i open the form and the value is not equal to false. Cos i have a if- else statement that checks if false, open report, and it doesnt work.
The form might be open manually or through the tools-startup

3. i have 4 if- else statements like below to check if the checkboxes are ticked
:
    If Me.chkbox1.Value = True Then
        DoCmd.OpenReport stDocName1, acViewNormal
    End If

 however, i just realised that if more than one box is ticked, only the first if- else statement is executed. how should i go about doing this for more than 1 reports to be printed or mailed? some sort of loop?

thanks in advance...
 
Old October 31st, 2003, 08:06 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 120
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Bubblez

The following function gives you complete control over the mouse cursor - place it in a new code module:
Code:
Declare Function LoadCursorBynum Lib "user32" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As Long) As Long

Declare Function LoadCursorFromFile Lib "user32" Alias "LoadCursorFromFileA" (ByVal lpFileName As String) As Long

Declare Function SetCursor Lib "user32" _
  (ByVal hCursor As Long) As Long

'Mouse Pointer Constants
Public Const IDC_APPSTARTING = 32650&
Public Const IDC_HAND = 32649&
Public Const IDC_ARROW = 32512&
Public Const IDC_CROSS = 32515&
Public Const IDC_IBEAM = 32513&
Public Const IDC_ICON = 32641&
Public Const IDC_NO = 32648&
Public Const IDC_SIZE = 32640&
Public Const IDC_SIZEALL = 32646&
Public Const IDC_SIZENESW = 32643&
Public Const IDC_SIZENS = 32645&
Public Const IDC_SIZENWSE = 32642&
Public Const IDC_SIZEWE = 32644&
Public Const IDC_UPARROW = 32516&
Public Const IDC_WAIT = 32514&


'*********** Code Start  ************
'Code Courtesy of
'Terry Kreft
'
Function MouseCursor(CursorType As Long)
On Error GoTo HandleErr

  Dim lngRet As Long
  lngRet = LoadCursorBynum(0&, CursorType)
  lngRet = SetCursor(lngRet)
ExitHere:
    Exit Function

' Error handling block added by Error Handler Add-In. DO NOT EDIT this block of code.
' Automatic error handler last updated at 01-11-2002 14:15:25   'ErrorHandler:$$D=01-11-2002    'ErrorHandler:$$T=14:15:25
HandleErr:
    Select Case Err.Number
        Case Else
            MsgBox "Error " & Err.Number & ": " & Err.Description, vbCritical, "Form_frmTasking.cmbJobNumber_AfterUpdate"   'ErrorHandler:$$N=Form_frmTasking.cmbJobNumber_AfterUpdate
'ErrorHandler:$$N=Form_frmTasking.cmbJobNumber_AfterUpdate
    End Select
    Resume ExitHere
' End Error handling block.

End Function
To make your cursor change shape, place the following code in the MouseMove event of your label:
Code:
MouseCursor IDC_HAND
To change the cursor back when it leaves the label, put this code in the forms Detail sections MouseMove event:
Code:
MouseCursor IDC_ARROW
You can also use
Code:
MouseCursor IDC_WAIT
whenever you wish to display the hourglass.

To make a checkbox equal to false when your form is opened, just set the Default Value property of each checkbox to False.


Brian Skelton
Braxis Computer Services Ltd.
 
Old November 3rd, 2003, 04:53 AM
Authorized User
 
Join Date: Sep 2003
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hey. thanks so much... works perfectly. i din have to use IDC_ ARROW though...





Similar Threads
Thread Thread Starter Forum Replies Last Post
Access reports to word as print preview nbrault Pro VB Databases 0 January 15th, 2007 03:29 PM
Access reports to word as print preview nbrault Pro VB 6 0 January 15th, 2007 03:24 PM
Automated Mail Merge Print jcellens Access 0 June 22nd, 2006 05:10 PM
print multiple times..multiple rows... abhit_kumar JSP Basics 3 January 18th, 2005 07:11 PM
cannot print reports Tasha Access VBA 0 August 25th, 2004 03:40 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.