Too much complicated(for me)

  • Thread starter Thread starter spawnss
  • Start date Start date
S

spawnss

Hi all,

I have 3 checkboxes "Instrument", "Electrical", "Mechanical". Control source
data types are yes/no. I want to create automatic print out like if check box
"Instrument" and "Electrical" checked, put "I" & "E" in specific text box in
another form. Like (I & E). Can Access do that?

Thank you.
 
Call this sub from the After Update event of all 3 check boxes:

Private Sub CheckTheBoxes()
Dim strRet As String

If Me.chkInstrument Then
strRet = "I"
End If
If Me.chkElectrical Then
If Len(strRet) > 0 Then
strRet = strRet & " & "
End If
strRet = strRet & "E"
End If
If Me.chkMechanical Then
If Len(strRet) > 0 Then
strRet = strRet & " & "
End If
strRet = strRet & "M"
End If

'Be sure the other form is open
If CurrentProject.AllForms("TheOtherFormName").IsLoaded Then
Forms!TheOtherFormName!MyTextBox = strRet
End If
End Sub

Just change the names to your real names.
 
Back
Top