Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Ampersand sign behind number

Posted on 2011-09-05
12
Medium Priority
?
618 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
12 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

671 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