Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy text box string

Status
Not open for further replies.

NakedZero

Technical User
Oct 27, 2004
21
US
I need to copy the text in a text box when I am in a form, I have tried different ways but I can not seem to get it right, I have tried dim strClaim as string, and then strClaim = ClaimNum which is the name on the form from a query of a table. If anyone can help it would be much appreciated :)
 
Something like this ?
strClaim = Me![Name of ClaimNum control]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I tried that and I get a runtime error '91' object variable or with block variable not set. That is where I keep getting stuck, your help is very appreciated :)
 
Where have you tried this code ?
I'm afraid that if you really want some help you have to provide more info.
Feel free to read either one of the FAQs in my sig.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
My apologies, the code is in the form current event, when the focus is on a new form I have this bit of code:

Private Sub Form_current()

Dim strCopiedClaim As String



strClaim_Processor = GetWindowsUserName
Me.dtmTodays_Date = Date
DoCmd.RunCommand acCmdSaveRecord

strCopiedClaim = Me!ClaimNum

End Sub

but when I run the form now, it just pastes the last value I copied and not the text in the textbox. I am confused :(
 
Are you aware that the scope of strCopiedClaim is only the procedure ?
In your posted code I don't see the utility of this variable ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
My purpose is to just keep the string in memory so that when the form opens the text is just copied as if I had copied the text using ctrl+c or using the copy button.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top