image movement (1 Viewer)

murray83

Games Collector
Local time
Today, 10:55
Joined
Mar 31, 2017
Messages
728
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

  • player start.png
    player start.png
    3.4 KB · Views: 57
  • player after roll.png
    player after roll.png
    37.8 KB · Views: 53

Gasman

Enthusiastic Amateur
Local time
Today, 10:55
Joined
Sep 21, 2011
Messages
14,038
I would have thought you would just set left and top coordinates?
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 06:55
Joined
May 21, 2018
Messages
8,463
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
Local time
Today, 10:55
Joined
Mar 31, 2017
Messages
728
in my table the textboxes are all numbered 0 to 39

as can see in attached work so far
 

Attachments

  • Mon.accdb
    784 KB · Views: 68

CJ_London

Super Moderator
Staff member
Local time
Today, 10:55
Joined
Feb 19, 2013
Messages
16,553
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
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 06:55
Joined
May 21, 2018
Messages
8,463
Simple Example
 

Attachments

  • MoveImage.accdb
    396 KB · Views: 57

isladogs

MVP / VIP
Local time
Today, 10:55
Joined
Jan 14, 2017
Messages
18,186
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

Top Bottom