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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Continues form with only one checkbox = true 1

Status
Not open for further replies.

vdzr

Technical User
Mar 6, 2003
42
DE
What is the way to go for:

1)look in all (sub)records from one client(record) if there is a checked box? (validation???)
2)Event before/after update : If a checkbox is set to true --> every other (sub)recordscheckbox must be false

thanks already
 
what result are you wanting to achieve? returning all true records or all false ones?

Ian Mayor (UK)
Program Error
Your lack of planning is not my emergency!
 
Every client has about 15 records with a yes/no field. Only one record from the 15 may have a yes selected.
 
How are ya vdzr . . .

Note sure of your table setup or field names, but here's an example:
Code:
[blue]   Dim Msg As String, Style As Integer, Title As String
   Dim DL As String, Cri As String
   
   DL = vbNewLine & vbNewLine
   Cri = "[[purple][b][i]ClientID[/i][/b][/purple]] = " & Me![purple][b][i]ClientID[/i][/b][/purple] & " AND " & _
         "[![purple][b][i]CheckboxName[/i][/b][/purple]] = true"
            
   If DCount([[purple][b][i]ClientID[/i][/b][/purple]], "[purple][b][i]TableName[/i][/b][/purple]", Cri) > 0 Then
      Msg = "Only One Checkbox Selection Allowed!" & DL & _
            "Remember this for future reference . . ."
      Style = vbCritical + vbOKOnly
      Title = "Checkbox Count Error! . . ."
      MsgBox Msg, Style, Title
      [b]Cancel = True[/b]
   End If[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top