keeping Track Of Record 
Author Message
 keeping Track Of Record

I have a (shoe of cards) 416 records.  I need to goto the 11th record in the
recordset and deal that card to the 1st player
move to the next record and deal that to the second player 13th record to
the 1st player 14th record to the 2nd player.
I think I need 3 cmdbuttons to accomplish what I need to do but would
appreciate your ideas on this.

FirstCmdButton would run this code. (This is run only after a shuffle of the
cards)

Dim db As DAO.Database
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("tblDecksOfCards")
rs.How do I move to the 11th record?
Me.PC1 = rs![cardname]
Me.PC1Value = rs![cardvalue]
rs.MoveNext
Me.BC1 = rs![cardname]
Me.BC1Value = rs![cardvalue]
rs.MoveNext
Me.PC2 = rs![cardname]
Me.PC2Value = rs![cardvalue]
rs.MoveNext
Me.BC2 = rs![cardname]
Me.BC2Value = rs![cardvalue]

I then evaluate the values in both hands and based on those values either
deal another card to neither, 1, or both players

SecondCmdButton
The card or cards are dealt to the appropriate player or the hand is
determined to be over
I need help with keeping track of where I am in the recordset and keeping
the recordset open between cmdbuttons

ThirdCmdButton
Runs the same routine as above but starts with the next record in the
recordset and not the 11th record.
I need help with keeping track of where I am in the recordset and keeping
the recordset open between cmdbuttons
rs.MoveNext
Me.PC1 = rs![cardname]
Me.PC1Value = rs![cardvalue]
rs.MoveNext
Me.BC1 = rs![cardname]
Me.BC1Value = rs![cardvalue]
rs.MoveNext
Me.PC2 = rs![cardname]
Me.PC2Value = rs![cardvalue]
rs.MoveNext
Me.BC2 = rs![cardname]
Me.BC2Value = rs![cardvalue]

If necessary click SecondCmdButton else run this routine again and evalulate
3rd card decisions.

My major problem is understanding how to keep the recordset open, keep track
of where the pointer is for the move.next routine.

It would be great If this was a one button routine tha could determine if it
was the start of the game and go to record 11 or not start of game and run
the proper routine based on where I was in the sequence.

Any help would be appreciated.

Thanks in advance.



Thu, 27 Jan 2005 13:55:23 GMT  
 keeping Track Of Record
Hi,
Check out the Move method.
If you want your recordset to persist,
declare it in the Declarations section (top of
code module). To keep track of things, use Bookmarks.

HTH
Dan Artuso, MVP

Quote:

> I have a (shoe of cards) 416 records.  I need to goto the 11th record in the
> recordset and deal that card to the 1st player
> move to the next record and deal that to the second player 13th record to
> the 1st player 14th record to the 2nd player.
> I think I need 3 cmdbuttons to accomplish what I need to do but would
> appreciate your ideas on this.

> FirstCmdButton would run this code. (This is run only after a shuffle of the
> cards)

> Dim db As DAO.Database
> Dim rs As DAO.Recordset
> Set rs = CurrentDb.OpenRecordset("tblDecksOfCards")
> rs.How do I move to the 11th record?
> Me.PC1 = rs![cardname]
> Me.PC1Value = rs![cardvalue]
> rs.MoveNext
> Me.BC1 = rs![cardname]
> Me.BC1Value = rs![cardvalue]
> rs.MoveNext
> Me.PC2 = rs![cardname]
> Me.PC2Value = rs![cardvalue]
> rs.MoveNext
> Me.BC2 = rs![cardname]
> Me.BC2Value = rs![cardvalue]

> I then evaluate the values in both hands and based on those values either
> deal another card to neither, 1, or both players

> SecondCmdButton
> The card or cards are dealt to the appropriate player or the hand is
> determined to be over
> I need help with keeping track of where I am in the recordset and keeping
> the recordset open between cmdbuttons

> ThirdCmdButton
> Runs the same routine as above but starts with the next record in the
> recordset and not the 11th record.
> I need help with keeping track of where I am in the recordset and keeping
> the recordset open between cmdbuttons
> rs.MoveNext
> Me.PC1 = rs![cardname]
> Me.PC1Value = rs![cardvalue]
> rs.MoveNext
> Me.BC1 = rs![cardname]
> Me.BC1Value = rs![cardvalue]
> rs.MoveNext
> Me.PC2 = rs![cardname]
> Me.PC2Value = rs![cardvalue]
> rs.MoveNext
> Me.BC2 = rs![cardname]
> Me.BC2Value = rs![cardvalue]

> If necessary click SecondCmdButton else run this routine again and evalulate
> 3rd card decisions.

> My major problem is understanding how to keep the recordset open, keep track
> of where the pointer is for the move.next routine.

> It would be great If this was a one button routine tha could determine if it
> was the start of the game and go to record 11 or not start of game and run
> the proper routine based on where I was in the sequence.

> Any help would be appreciated.

> Thanks in advance.



Fri, 28 Jan 2005 02:53:47 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Database help - keeping track of records...

2. using 3rd pty sw, keeping track of records

3. Database help - keeping track of records...

4. keeping track of records loaded to sql

5. Keep track of excludes for each record

6. Keep Track of Excluded Users for each Record

7. JCN - KEEPING TRACKS OF ALL CHANGES TO RECORDS IN AN ACCESS DATABASE

8. Keep Track of Excluded Users for each record

9. Keeping Track of Database Modifications?!?!

10. Keeping track of Users Online

11. Keeping track of Database changes!?

12. KEEPING TRACK OF WORD DOC FILES

 

 
Powered by phpBB® Forum Software