Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checkboxes

Status
Not open for further replies.

entwistle18

Technical User
Apr 29, 2004
16
GB
Hi all this is my first post.

I have designed at football club database for my friend and have I slight problem with a check box.

On the match form it contains details of who, when, where the club played a match. On this form I also have a sub form to allow a match day team to be entered. It is limited to sixteen players. I record whether the player played, was a substitute, received a yellow card, received a red card, and was the man of the match. These are all recorded by check boxes.
The problem I have is that I only want one of the 16 records to be the man of the match. At the moment everyone can be man of the match.

I hope I have described my problem so that it is understandable. Any suggestions???

Many thanks in advance
 
What you need to do is to make that 'M' column the option group. Then only one check box in that column can be checked.

[blue]"Well, once again my friend, we find that science is a two headed beast. One head is nice, it gives us aspirin and other modern conveniences,...but the other head of science is BAD! Oh, beware the other head of science, Arthur; it bites!!" - The Tick[/blue]
 
i cannot get it to work that way. can you show me the other way

cheers
 
The other way is unfortunately typing intensive. In the onclick event for every checkbox that you want to be exclusive, you need to put code that will uncheck every other checkbox that you want to be exclusive. Not complicated, but certainly tedious.

[blue]"Well, once again my friend, we find that science is a two headed beast. One head is nice, it gives us aspirin and other modern conveniences,...but the other head of science is BAD! Oh, beware the other head of science, Arthur; it bites!!" - The Tick[/blue]
 
Briefly, if I have two checkboxes named Check1 and Check2, then I would need this:
Code:
Private Sub Check1_Click()
    Check2.Value = 0
End Sub

Private Sub Check2_Click()
    Check1.Value = 0
End Sub
You will need to do this for all 16 of your checkboxes listing each of the other checkboxes in a given checkbox's click event and setting their values to 0.

[blue]"Well, once again my friend, we find that science is a two headed beast. One head is nice, it gives us aspirin and other modern conveniences,...but the other head of science is BAD! Oh, beware the other head of science, Arthur; it bites!!" - The Tick[/blue]
 
is the default value of MOM set to FALSE in the table?

Leslie
 
TomThumbkp
I dont think we are thinking the same. I dont think i am clear enough.
For every match the club plays it creates a record. Within each match it creates a record for every player that plays a match. hence 16 records. I want it to select one individual record to be the man of the match. I only have one checkbox for man of match which could be selected on all 16 records but i want it to be selected by one record.

I thank you for your time again. i hope this is more clearer to you. If you could help it would be great i am sure it is just a validation check that needs doing

I have to go now thanks for your time. Any suggustions please post them

Thanks

Gareth

PS thanks lesie
 
I am confused. For 1 match there are 16 records in the table? One of the fields in every record is MOM. You want to make sure that when all is said and done, only one record for each match has a true value and the rest are false. Is this correct?

[blue]"Well, once again my friend, we find that science is a two headed beast. One head is nice, it gives us aspirin and other modern conveniences,...but the other head of science is BAD! Oh, beware the other head of science, Arthur; it bites!!" - The Tick[/blue]
 
I think he means he has

tblMatch
MatchID
HomeTeamID
AwayTeamID
other stuff

tblMatchPlayers
MatchID
PlayerID

so for every new match created, he finds all the players on both of those teams and creates a new entry in tblMatchPlayers.



Leslie
 
hi all

sorry for the delay i have been away for the week

tomthumbuk: your statement is totally correct.

Leslie: the setup is basically correct. I only record the details of one club Padiham Town. i have
tblmatch
MatchID
HomeTeam ( this is set to PTFC and never changes)
AwayTeamID
other stuff

tblteamplayers
matchid
squadno
apps
subapps
yel
red
MOM <-

so basically i want one record of the teamplayers to be man of the match. I hope this is a little clearer

Any suggestions and the greatest of thanks to you both.

gareth
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top