Too much complicated(for me)

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.
 
K

Klatuu

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top