Copy/Paste command on a form

Brando

Enthusiastic Novice
Local time
Today, 15:05
Joined
Apr 4, 2006
Messages
100
Copy/Paste

I have a textbox on a form that automatically shows the current date. Below that, I have 3 other textboxes for dates (each representing a step in a process). Often, the same date is imputed into each of these boxes. I would like to have an “Autofill” command button that would take the date in the first box and place it in the other three. This is so basic it’s hard. My usual searches turn up nothing. Any suggestions welcome.
 
Try this code in the VB editor of your button click event:

Code:
Dim strCopiedText as String
strCopiedText = txtBox1
txtBox2 = strCopiedText

End Sub

Just substitute the "txtBox1" and "txtBox2" with the names of your 2 text boxes.:)
 
That did it! Thank you so much!
 
Why not simplify it to just the basics?

Code:
txtBox2 = txtBox1
 

Users who are viewing this thread

Back
Top Bottom