PC Review


Reply
Thread Tools Rate Thread

Changing Bound Text Box Border Width Property Screws Up Tab Order

 
 
Dan
Guest
Posts: n/a
 
      28th Sep 2011
Hi, I am using Access 2007. I have module sub that is passed the
form's name and it checks to see if control is a text box that just
received focus and if so thickens it border to queue user where
insertion pointer is. The problem is as the user tabs from control
to control the text will disappear in the text box teh got the focus
and reappear on exit from control of a mouse click in it. In addition
the tab order no longing works either. Here is the code:

' This function, HighlightTextbox(), highlights a textbox border to
indicate it has the Focus and de-highlights
' previous object focus if textbox. Since Access cannot trigger this
function on the form level, a call must be made
' in each textbox on the form.
Public Sub HighlightTextbox(strCallingForm As String)

Dim ctrlActive As Control
Dim strActiveControlSource As String
Dim ctrlPrev As Control
Dim strPrevControlSource As String
Dim intRetval As Integer


On Error GoTo HighlightTextbox_Error


'If Forms(strCallingForm).Visible = True Then

'Forms(strCallingForm).AllowEdits = False

Set ctrlActive = Screen.ActiveControl

If TypeOf ctrlActive Is TextBox Then
'ctrlActive.Enabled = False
'strActiveControlSource = ctrlActive.ControlSource
'ctrlActive.ControlSource = ""
'ctrlActive.Locked = True
ctrlActive.BorderWidth = 2
intRetval = DoEvents()
Debug.Print "active", ctrlActive.Name
End If

Set ctrlPrev = Screen.PreviousControl
If TypeOf ctrlPrev Is TextBox Then
'ctrlPrev.Enabled = False
'strPrevControlSource = ctrlPrev.ControlSource
'ctrlPrev.ControlSource = ""
'ctrlPrev.Locked = True
ctrlPrev.BorderWidth = 0
intRetval = DoEvents()
Debug.Print "previous", ctrlPrev.Name
End If

Debug.Print Time, ctrlActive.Name, ctrlPrev.Name
'ctrlActive.Enabled = True
'ctrlPrev.Enabled = True
'ctrlActive.ControlSource = strActiveControlSource
'ctrlPrev.ControlSource = strPrevControlSource
'ctrlActive.Locked = False
'ctrlPrev.Locked = False
'Forms(strCallingForm).AllowEdits = False

'End If

Exit Sub

HighlightTextbox_Error:

Exit Sub

End Sub

How can I get Access to behave properly? I am assuming I have to
suspend the Control Source in some fashion but tried many ways with no
luck. TIA
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Image adding border-width:0; when I do not specify the BorderWidth property Nathan Sokalski Microsoft ASP .NET 1 7th Nov 2007 04:30 PM
Binding text box to object's property not properly bound! teddysnips@hotmail.com Microsoft C# .NET 0 15th May 2007 04:29 PM
border width from Borderstyle property --== Alain ==-- Microsoft C# .NET 2 10th Feb 2007 03:40 PM
Drop Down List Border Width vs Text Box Border Width Coder Microsoft ASP .NET 1 24th Jun 2006 02:27 PM
Changing internal border width of taskbar buttons ihatespam Windows XP General 1 19th Aug 2004 12:17 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:10 PM.