image movement (1 Viewer)

murray83

Games Collector
Joined
Mar 31, 2017
Messages
488
can someone tell me whether the following is possible.

trying to make an image move to different positions in the form based on criteria in a dlookup

see two attached images for what i would like or am i being to ambitious and foolhardy
 

Attachments

Gasman

Enthusiastic Amateur
Joined
Sep 21, 2011
Messages
5,016
I would have thought you would just set left and top coordinates?
 

MajP

Access MVP
Joined
May 21, 2018
Messages
2,350
Should be possible. In your table I would store all off my label names with the positions (top and left). So if moving to fleet street you can use your dlookup to return that labels name and the location to move your image.
 

murray83

Games Collector
Joined
Mar 31, 2017
Messages
488
in my table the textboxes are all numbered 0 to 39

as can see in attached work so far
 

Attachments

CJ_London

Super Moderator
Staff member
Joined
Feb 19, 2013
Messages
11,573
you could give your labels names that match their order with some calculations to determine side.
e.g.

Go=lbl00
OldKentRoad=lbl01
Pentonville=lbl09
Jail=lbl10
Mayfair=lbl39
etc

to start
player1 uses token1
player1PreviousValue=0

provide some offsets so tokens don't cover each other
token1Offset=1000
token2Offset=500
etc

player1 rolls the dice
dicevalue=dice1+dice2 (e.g.3+5)=8
token1.left=me("lbl" & format(player1previousvalue+dicevalue mod 40,"00").left+token1offset
token1.top=me("lbl" & format(player1previousvalue+dicevalue mod 40,"00").top+token1offset
player1previousvalue=player1previousvalue+dicevalue mod 40
 

isladogs

CID Moderator
Staff member
Joined
Jan 14, 2017
Messages
12,335
You might find this example useful as well Reaction Timer.
Code is used to move an object to random positions on a form
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom