Process audit DB

ZFQualityTech

New member
Local time
Yesterday, 22:00
Joined
Mar 11, 2009
Messages
2
I am a newbie at Access so please excuse me if this is a stupid question.
I will try to explain what I'm trying to do as best as possible.

If I have checkboxes A, B, C, and one Textbox #1. I want one of three questions entered into the textbox depending on what checkbox is selected. For example if check box A is selected question 1 will appear in text box #1. If check box B is selected question 2 will appear in text box #1.
Is this possible? Any help would be appreciated.
 
Use the on click event of each checkbox and test for the ticked status and if it is ticked then set the text field accordingly.

However I would be tempted to use an option group as this will toggle the previously ticked boxes off. As you can only make one selection in an option group. Similar to what you are describing


Code:
Sub Options_Click(Index As Integer)

Select Case Index
    Case 1 :Me.TextBox1 = "Question 1"
    Case 2 :Me.TextBox1 = "Question 2"
    Case 3 :Me.TextBox1 = "Question 3"
End Select

End sub
 
This is why DCrake's suggestion is the best. But your request can be accomplished by...

Code:
Private Sub chkOne_Click()

    chKTwo.Value = False
    chkThree.Value = False
    txtText = ""
    
    If chkOne.Value = True Then
        txtText = "ONE"
    End If
    
End Sub

Private Sub chKTwo_Click()

    chkOne.Value = False
    chkThree.Value = False
    txtText = ""
    
    If chKTwo.Value = True Then
        txtText = "TWO"
    End If
    
End Sub

Private Sub chkThree_Click()

    chkOne.Value = False
    chKTwo.Value = False
    txtText = ""
    
    If chkThree.Value = True Then
        txtText = "THREE"
    End If
    
End Sub
 
Ok, well I had a feeling you needed some kind of code to accomplish this. I am not experienced in writing or using codes. Could you please give me some more details on how to use the code???? I apologise for my newbieness. My work gave me the task of updating our databases during our program downtime so I have just been learning Access as I go. Thanks again for your help.
 

Users who are viewing this thread

Back
Top Bottom