copy field contents

J

jesseb

I have a form that I would like to copy the text out of and place it in a
variable.
The field is tab stop 1 and has text I want to capture and place in a
variable MySubject. The issue is the text box content is created from a drop
down that gets filled by another field. In other words the ClassID is used to
pull the ClassName.
so the field is filled with the text describing the class not the ClassID
number.

I have a button that opens my email on my form where the text field lives
and I want to pickup the text pass it to my variable (MySubject).

Thanks to anyone who can help me on this one.
 
G

Graham Mandeno

Hi Jesse

You can simply assign the value of a control to your variable:

MySubject = Me.txtSomeTextBox

If the value is in the bound column of a combo box (as it sounds like for
ClassID) then the syntax is the same:

MySubject = Me.cboClassID

If the value is in another column of a combo box (ClassName) then use the
Column property:

MySubject = Me.cboClassID.Column(1)
 

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