Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can I record a macro on a cell that has text but not a text box | Excel Worksheet Functions | |||
while entering text excel should not accept duplicate record..? | Excel Worksheet Functions | |||
text box insert in Excel - text box lines print on second copy | Excel Discussion (Misc queries) | |||
Search for text, copy the number in front of text | Excel Programming | |||
open some txt files ,find text , copy the text before that to a single cell | Excel Programming |