Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Ampersand sign behind number

Posted on 2011-09-05
12
Medium Priority
?
622 Views
Last Modified: 2012-05-12
Hi there,

On a site I found a nice piece of code to change the cursor from an arrow to a hand while moving over the button. (http://www.access-programmers.co.uk/forums/archive/index.php/t-15232.html)

What puzzles me is what the Ampersand character (&) is doing behind the numbers.

An example: Public Const IDC_HAND = 32649&

Why is this sign there? What's the use?

An explanation is welcome.

Nico.
0
Comment
Question by:Nico_W
11 Comments
 
LVL 75
ID: 36485188
For any Control that has a Hyperlink Address, if you type just a single Space, this will make the hand appear ...

mx
Capture1.gif
Capture2.gif
0
 
LVL 21

Expert Comment

by:Papertrip
ID: 36485198
What puzzles me is what the empercent-sign (&) is doing behind the numbers.

The correct word is ampersand :)
0
 
LVL 75
ID: 36485206
OR ... you can use this code, which is what I use:

Option Compare Database
Option Explicit

   'This code for Cursors was originally written by Terry Kreft.
   'Also, SSF_DsplyMouseCursor and SSF_DsplyIcon (both modified by ADI)
   
    Declare Function adiSWA_LoadCursorByNum Lib "user32" Alias "LoadCursorA" _
      (ByVal hInstance As Long, ByVal lpCursorName As Long) As Long
   
    Declare Function adiSWA_LoadCursorFromFile Lib "user32" Alias _
      "LoadCursorFromFileA" (ByVal lpFileName As String) As Long
   
    Declare Function adiSWA_adiSetCursor Lib "user32" Alias "SetCursor" _
      (ByVal hCursor As Long) As Long

Function SSF_DsplyMouseCursor(sCursorType As String) As Boolean

'---------------------------------------------
' Action(s)       : Changes the mouse cursor to the type indicated by sCursorType.
' Comments        : Typically called from an object's MouseMove event
' Protocol        : =SSF_DsplyMouseCursor("Hand")
'---------------------------
' Argument     Description
' --------     -----------
' sCursorType  Cursor type desired, as specified below
        'Hand
        'AppStarting
        'No
        'Wait
        'Arrow
        'Cross
        'SizeAll
        'SizeNESW
        'SizeNS
        'SizeNWSE
        'SizeWE
        'UpArrow
'---------------------------
 
    Dim sCursors As String
    Dim iCursorPos As Integer
    Dim lCursorType As Long
   
    sCursors = "Hand32649AppStarting32650No32648Wait32514Arrow32512Cross32515SizeAll32646SizeNESW32643SizeNS32645SizeNWSE32642SizeWE32644UpArrow32516"
    iCursorPos = InStr(1, sCursors, sCursorType)
    lCursorType = Mid(sCursors, iCursorPos + Len(sCursorType), 5)
    Call adiSWA_adiSetCursor(adiSWA_LoadCursorByNum(0&, lCursorType))

End Function


Then, call this Function from the MouseMove event of any Control you want the Hand - see Image.

mx

Capture1.gif
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 44

Expert Comment

by:GRayL
ID: 36485373
& is the VBA character representing the Long datatype
0
 
LVL 44

Accepted Solution

by:
GRayL earned 500 total points
ID: 36485377
To state it more precisely, the type-declaration character for Long is the ampersand (&).
0
 
LVL 44

Expert Comment

by:GRayL
ID: 36485444
% is the type-declaration character for Integer which has values from -32768 to 32767

In the Immediate Pane I typed two multiplication and took a snapshot after the error message from the second multiplication The error message
0
 
LVL 75
ID: 36485456
Nico ... do it the one of two easy ways I posted.  I've been using those for years and they work.

mx
0
 
LVL 46

Expert Comment

by:aikimark
ID: 36485506
The character suffixes have fallen out of use and should be explicitly defined or cast

Public Const IDC_HAND As Long = 32649

x = CLng(32649)

Open in new window

0
 
LVL 75
ID: 36485515
@ http:#a36485206  - the simplified version that works    :-)
0
 
LVL 44

Expert Comment

by:GRayL
ID: 36485567
http:#a36485377 - answers the question ;-)
0
 

Author Closing Comment

by:Nico_W
ID: 36486478
All,

Great to see the enthusiasm with which this question was taken on.

To Papertrip and Aikimark: thanks for correcting me on the correct name of the sign. That's probably why I couldn't find an answer to the question on Google :-)

GRayL: Although DatabaseMX definitely gave the most extensive answers, I have to agree with you that you gave the answer to the question. Therefore, I will accept your solution.

DatabaseMX: the code on the page that I was referring to also originates from Terry Kreft. I will compare the two versions to see the differences. Anyway, I learned some new things from your posts. For instance, the comment on the hyperlinks is something that I was not aware of. In the business environment I am currently working in, they are still using Access 2003. Not sure if this option is already present there.

All,

Thanks very much for your answers.

Nico.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Suggested Courses

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question