1

I am building a form in MS Access and I am trying to use buttons to populate a sequence of text into a text box. The idea is that each button will add onto the information to the string sequence. So far I have only been able to populate the text box with the info of a single button, which gets replaced when another button is clicked.

I used the following for each button:

Private Sub btnBP_Click() 
    txtSequence.SetFocus 
    txtSequence.Text = "BP"

How can I make subsequent button clicks add onto the information and not replace it?

1 Answer 1

3

Don't replace the text, append the new text:

Private Sub btnBP_Click()

    Me!txtSequence.Value = Me!txtSequence.Value & "BP"

End Sub
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.