LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 411
Default textbox disappears using textbox.activate

This ''solution" didn't work for the end users. I'm developing an .xlt
file. The end users use a copy of the template.

When they tab or enter to go to the next textbox or combobox on the
worksheet, the object seems to get the focus but the end user can not
see it on the worksheet. If the user starts typing the object is
updated.

Has anyone else seen this type of behavior?

Can anyone recommend a way to keep the objects visible when receiving
the focus? I don't know how to test if the object actually has the
focus. All I know is if you start typing the object shows the text
just typed.

I'm using textboxes because I need to populate one of them with the an
sql statement and I wanted to reduce keystrokes and mouseclicks for
the end user.

I'm unable to generate consistent results. Sometimes the object
"disappears". Sometimes it has diagonal lines through it--at least you
can see it--and sometimes the object looks normal with the cursor
flashing and ready to accept data. Sometimes when I click the mouse
in the object--the cursor isn't shown--I have to click again to get
the cursor to show.

Here's a sample of code I'm using:

Private Sub ComboBox2_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
''' Check if the TAB or ENTER key was pressed.
If KeyCode = vbKeyTab Or KeyCode = vbKeyReturn Then
''' If this is Excel 97 you must select a cell
''' before attempting to activate another control.
If Val(Application.Version) < 9 Then
Me.Range("A1").Select
End If
''' Move the focus appropriately.
If CBool(Shift And 1) Then
''' The user was holding down the SHIFT key
''' move back to the previous control.
TextBox2.Activate
Else
''' Move to the next control.
TextBox4.Activate
Application.Calculate
End If
End If
End Sub
 
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
Textbox disappears from Excel paste into PowerPoint NickSteel Charts and Charting in Excel 0 December 6th 05 05:17 PM
Textbox disappears in large chart-Excel bug? [email protected] Excel Discussion (Misc queries) 2 November 1st 05 03:13 PM
Textbox disappears B. Scace Charts and Charting in Excel 2 August 29th 05 11:59 PM
textbox scrollbar disappears Yaniv Excel Discussion (Misc queries) 1 June 20th 05 11:31 PM
Excel VBA - Cursor disappears when validating content of a TextBox lonewolfbr Excel Programming 0 September 16th 04 09:49 PM


All times are GMT +1. The time now is 11:47 PM.

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

About Us

"It's about Microsoft Excel"