G
Green Biro
I have a form that is made up from a numbe of combo boxes each sourced by
different queries.
I have a 'submit' button on the form which (amongst other stuff) has the
following code
Set rsPlayer1 = Me.[cmbPlayer1].Recordset
Set rsPlayer2 = Me.[cmbPlayer2].Recordset
Set rsResult = Me.[cmbResult].Recordset
intPlayer1_Score = rsPlayer1.Fields("Points")
intPlayer2_Score = rsPlayer2.Fields("Points")
strPlayer1_Id = rsPlayer1.Fields("Player_Id")
strPlayer2_Id = rsPlayer2.Fields("Player_Id")
strResult = rsResult.Fields("Result")
strPlayer_Id always picks up the value that has been chosen in the combo box
but strResult >sometimes< returns a different record than that currently set
in the combo box and I don't know why. I wander if I'm making some
incorrect assumptions about the way Access handles recordsets and current
records but it really does seem to be random when the result combo box
misbehaves so I can't work it out.
Can anyone guide me please?
NB just for background info the rest of my code updates a hidden control on
the form and performs a 'new record' operation thus updating the table that
is the source of the form. If I try to save or exit the form without
clicking on my submit button, it wont save because of the outstanding
compulsory field. This is exactly the behaviour I want though it's possible
I'm not doing it the best way.
Any pointers gratefully received.
GB
different queries.
I have a 'submit' button on the form which (amongst other stuff) has the
following code
Set rsPlayer1 = Me.[cmbPlayer1].Recordset
Set rsPlayer2 = Me.[cmbPlayer2].Recordset
Set rsResult = Me.[cmbResult].Recordset
intPlayer1_Score = rsPlayer1.Fields("Points")
intPlayer2_Score = rsPlayer2.Fields("Points")
strPlayer1_Id = rsPlayer1.Fields("Player_Id")
strPlayer2_Id = rsPlayer2.Fields("Player_Id")
strResult = rsResult.Fields("Result")
strPlayer_Id always picks up the value that has been chosen in the combo box
but strResult >sometimes< returns a different record than that currently set
in the combo box and I don't know why. I wander if I'm making some
incorrect assumptions about the way Access handles recordsets and current
records but it really does seem to be random when the result combo box
misbehaves so I can't work it out.
Can anyone guide me please?
NB just for background info the rest of my code updates a hidden control on
the form and performs a 'new record' operation thus updating the table that
is the source of the form. If I try to save or exit the form without
clicking on my submit button, it wont save because of the outstanding
compulsory field. This is exactly the behaviour I want though it's possible
I'm not doing it the best way.
Any pointers gratefully received.
GB