Problem getting bet detail

Please post any questions regarding the program here.

Moderator: 2020vision

Problem getting bet detail

Postby Bez » Mon Jun 03, 2013 5:16 pm

I have an Access databae that is using the COM interface very successfully except that I cannot retrieve a BetDetail object.

Here is my simplified code
Dim Dtl As BettingAssistantCom.BetDetail
Dim Bets
Dim Bet
Bets = ba.getBets
If Not IsEmpty(Bets(0)) Then
For Each Bet In Bets
Debug.Print Bet.Ref
Dtl = ba.getBet(Bet.Ref)
Next
End If

This code crashes on the ba.getBet line
The debug line produces the reference 27514713692
When I checked my Betfair statement which shows bet references the reference appears to be correct with 27514713692

I get Error (91) Object variable or With block variable not set

Any suggestions would be most gratefully received.
Bez
 
Posts: 7
Joined: Sat Jul 30, 2011 9:42 pm

Postby kiint » Tue Jun 04, 2013 3:01 pm

I think your problem is that you need to use the Set statement to assign an object to an object.
You should probably Dim your objects accordingly as well.

I don't know if it'll work as I can't test it here but try the following:

Dim Dtl As object
Dim Bets as object
Dim Bet as object
Set Bets = ba.getBets
If Not IsNothing(Bets(0)) Then
For Each Bet In Bets
Debug.Print Bet.Ref
Set Dtl = ba.getBet(Bet.Ref)
Next
End If
kiint
 
Posts: 148
Joined: Tue Feb 23, 2010 12:12 am

Postby Bez » Tue Jun 04, 2013 3:44 pm

Thanks for responding.

I made those changes but still get the same error.

BTW, IsNothing is not a legal statement.

It appears to get the list of bets because it gets the correct ref but the getBet using that ref fails. I even tried assigning the Bet.Ref to a string in case it was a datatype issue but that made no difference either. This driving me nuts.
Bez
 
Posts: 7
Joined: Sat Jul 30, 2011 9:42 pm

Postby Bez » Tue Jun 04, 2013 6:12 pm

I have cracked it.

I tried several things but then changed the DIM for the bet detail to DIM Dtl as Betdetail and I'm now getting results.
Many thanks for looking at this for me.
Bez
 
Posts: 7
Joined: Sat Jul 30, 2011 9:42 pm

Postby peleus » Sat Jun 15, 2013 1:23 am

Thanks Bez. This did it for my brother in law too.

changed the DIM for the bet detail to DIM Dtl as Betdetail
Nothing is coincidence. Image
peleus
 
Posts: 41
Joined: Tue Apr 23, 2013 11:41 pm


Return to Help

Who is online

Users browsing this forum: Google [Bot] and 51 guests

Sports betting software from Gruss Software


The strength of Gruss Software is that it’s been designed by one of you, a frustrated sports punter, and then developed by listening to dozens of like-minded enthusiasts.

Gruss is owned and run by brothers Gary and Mark Russell. Gary discovered Betfair in 2004 and soon realised that using bespoke software to place bets was much more efficient than merely placing them through the website.

Gary built his own software and then enhanced its features after trialling it through other Betfair users and reacting to their improvement ideas, something that still happens today.

He started making a small monthly charge so he could work on it full-time and then recruited Mark to help develop the products and Gruss Software was born.

We think it’s the best of its kind and so do a lot of our customers. But you can never stand still in this game and we’ll continue to improve the software if any more great ideas emerge.