Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Copy text from Ms Access record to Excel text box

When I execute code and click on the button the text does not appear in
the textbox. The rest of the code seems to be working except that "text
box" thing. What am I doing wrong?


Private Sub Command105_Click()

Dim strText As Variant
Dim FirstRec As String
Dim LastRec As String

Set RecSet = Me.RecordsetClone

FirstRec = InputBox("First record: ", "First record", 0, 0, 0, 0, 0)

RecSet.MoveFirst


Set ExcelApp = CreateObject("Excel.Application")
With ExcelApp
..Workbooks.Open "Q:\DATA\PRODUCTION\NPDJG.XLS"
..Visible = True
End With

Me.Current_Situation.SetFocus

RecSet.Move (Int(FirstRec))

Set WSheet = ExcelApp.Worksheets(1)
strText = Me("Current Situation").Value

'WSheet.Shapes("Text Box 2").Select
WSheet.Shapes("Text Box 2").TextFrame.Characters.Text = strText


'Set ExcelApp = Nothing
'Set WSheet = Nothing

End Sub

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I record a macro on a cell that has text but not a text box Bryan De-Lara[_2_] Excel Worksheet Functions 2 November 2nd 08 05:45 PM
while entering text excel should not accept duplicate record..? HAYAT Excel Worksheet Functions 1 December 5th 07 07:37 AM
text box insert in Excel - text box lines print on second copy Diana (Berry & Co) Excel Discussion (Misc queries) 0 July 26th 06 04:39 AM
Search for text, copy the number in front of text w0cyru01 Excel Programming 4 August 3rd 05 05:15 PM
open some txt files ,find text , copy the text before that to a single cell gus Excel Programming 2 July 11th 05 05:40 PM


All times are GMT +1. The time now is 02:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"