Discussion Locked

Copy text box content between text boxes

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hello,

I am using Microsoft Access.
I have two forms on the screen
Each form has a text box.
I need a way to copy the contents from one text box to another.
I would like to have a command button to achieve this.

Thank you.

3 replies

by sgt_shultz

what version of access?
try this. say your first text box is text0 and your second is text1. set the control source property of text1 to this expression:
=[formname].[text0].[ControlSource]
does that get you closer to where you want to be?

by techrep

'I think this is a slight improvemnt on Sgt 'Shultz' suggestion.
'me.text1=me.text0

This is the right idea but only works if you're copying the text to another box on the same form. You need to explicitly identify the receiving form with its name (not Me.):

Forms!ReceivingFormName.Text1 = Me.Text1

Also, the receiving form has to be open at the time. This code would go behind the command button on your sending form.

This discussion is closed to new replies.