I don’t even know if this can be done, but here goes:
Using Access 2007, I have a table of playing cards, and am using an attachment field to show their images on a conventional bound form. And all is working well with this.
Now, I am trying to lay out an unbound form upon which I want to randomly display several images of the cards in different positions, with textboxes showing their card names next to them. I have been using a command button to run code that picks random card names from my table and displays them in textboxes, but I haven’t been able to figure out how to display the corresponding pictures.
For what it’s worth, here’s the code I’m using to randomize the various textboxes (I’m only working with a couple until I can figure this out):
I hope I’ve told you everything you need to know. There isn’t much more to the app.
Any help you can give me will be greatly appreciated.
LM
Using Access 2007, I have a table of playing cards, and am using an attachment field to show their images on a conventional bound form. And all is working well with this.
Now, I am trying to lay out an unbound form upon which I want to randomly display several images of the cards in different positions, with textboxes showing their card names next to them. I have been using a command button to run code that picks random card names from my table and displays them in textboxes, but I haven’t been able to figure out how to display the corresponding pictures.
For what it’s worth, here’s the code I’m using to randomize the various textboxes (I’m only working with a couple until I can figure this out):
Code:
Private Sub cmdNewLayout_Click()
Me.txtPos1 = Int((78 - 1 + 1) * Rnd + 1)
Me.txtPos2 = Int((78 - 1 + 1) * Rnd + 1)
Me.txtCard1 = DLookup("CardName", "qryCardMeanings-Base", "CardID=" & me.txtPos1)
Me.txtCard1Suit = DLookup("Suit", "qryCardMeanings-Base", "CardID=" & me.txtPos1)
Me.txtCard2 = DLookup("CardName", "qryCardMeanings-Base", "CardID=" & me.txtPos2)
Me.txtCard2Suit = DLookup("Suit", "qryCardMeanings-Base", "CardID=" & me.txtPos2)
End Sub
Any help you can give me will be greatly appreciated.
LM