I have a table of Transactions that show up in my vertical gallery. Each transaction has a bookie name. I also have several bookie tables with details of the transaction. I am trying to get my form to show the details relating to the bookie name. The top image shown will work if I hard code the "Ladbrokes" bookie name but when I try and reference it in the middle image, it recognises the bookie name but does not work. I even tried setting a variable as 'varBookie' on the last image which shows "Ladbrokes" but again doesn't work. I have spent days trying to figure this out but I am still very new to this. Please help.
In case the text is too small to see, here are the texts in the formula bars.
LookUp( Ladbrokes, TransID = Gallery1.Selected.TransID, Stake )
LookUp( Gallery1.Selected.BackBookie, TransID = Gallery1.Selected.TransID, Stake )
LookUp( varBookie, TransID = Gallery1.Selected.TransID, Stake )
Solved! Go to Solution.
I have managed to find a workaround by using the Switch command which has worked. I would prefer a better solution but here is my solution with just a few of the bookies if it helps anyone.
Switch(Gallery1.Selected.BackBookie,"Ladbrokes",LookUp(Ladbrokes,TransID = Gallery1.Selected.TransID, Stake),
"Novibet",LookUp(Novibet,TransID = Gallery1.Selected.TransID, Stake),
"Bet365T",LookUp(Bet365T,TransID = Gallery1.Selected.TransID, Stake),
"Betfred",LookUp(Betfred,TransID = Gallery1.Selected.TransID, Stake),
"Coral",LookUp(Coral,TransID = Gallery1.Selected.TransID, Stake),
"Race Bets",LookUp(RaceBets,TransID = Gallery1.Selected.TransID, Stake),
"A888Sport",LookUp(A888Sport,TransID = Gallery1.Selected.TransID, Stake)
)
It not clear whether you are looking up in the same table or another table?
But try:
LookUp(YourTableName, TransID = Gallery1.Selected.TransID, Stake )
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Thank you for your reply. I had tried that in my first image where I hard coded the table "Ladbrokes" but when I change the selection in the gallery view (which uses the "Transactions" table) it does not reference the new selection bookie. Table examples:
Table1 -Transactions Table2 Ladbrokes Table3 Coral Table4 Bet365
TransID Bookie Stake Odds TransID Stake Odds TransID Stake Odds Tran...
1 Ladbrokes 10 3 1 5 2 2 2 3 3
2 Coral 15 2 12 12 5 10 15 4 17
3 Bet365 5 1.5 13 6 3 14 10 2 18
I hope this helps.
Did you get error by trying:
LookUp(Ladbrokes, TransID = Gallery1.Selected.TransID, Stake )
From your table, only one row of Transaction matches with LadBrokes
if you still have issues, show a screenshot of the form with the default of the textbox to pupolate
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Yes LookUp(Ladbrokes, TransID = Gallery1.Selected.TransID, Stake ) works.
But as that is hard coded to the Ladbrokes table, when I change it to a different selection in the gallery to Coral, it will not work.
How do you make the change? "when I change it to a different selection in the gallery to Coral, it will not work"
Are you using different Gallery at same time?
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
You have confirmed that this formula works.
Yes LookUp(Ladbrokes, TransID = Gallery1.Selected.TransID, Stake ) works
Note you have about three tables with different columns. You cannot put all the three on the same Gallery.
So if you want all the three on the same Gallery, then I suggest you combine the tables into one.
Then the Combined table Will be put on the items of the Gallery.
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Thanks again for your reply.
Yes, if I put "Ladbrokes" in hard code it will work but I wanted it like a variable so that I could change the table according to the selection in the Gallery. This is because there are around 20 tables but I have only shown 3 as an example.
From my screenshot it shows that when I use "Gallery1.Selected.BackBookie" it gives me the text of "Ladbrokes" and if I change my selection in the Gallery it will show "Bet365" for example but the Lookup function does not seem to like it unless it is hard coded.
I am unable to put all 20 tables into one file as they include calculations that are specific to each table.
User | Count |
---|---|
183 | |
108 | |
88 | |
44 | |
42 |
User | Count |
---|---|
226 | |
108 | |
105 | |
68 | |
68 |