That link goes to an error page.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Sorry Try This, example works on main form but not on subform. http://www.pcreview.co.uk/threads/se...ng-vb.2070812/
Well, it should.
Need something to analyze. Post code or provide db.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Hi,
Below is code for transparent command button.
Private Sub Command27_Click()
Me.Combo_thisweek_code.SetFocus
End Sub
Code for Combo.
Private Sub Combo_thisweek_code_GotFocus()
With Me.Combo_thisweek_code
.SelStart = 0
.SelLength = Len(.Text)
End With
End Sub
Code works on mainform (with correct combo names)but not on subform
Redkyte.
I have never used Text property. I use Value.
What do you mean by 'transparent' button?
If the combo is empty (Null) the code will error.
Len(Nz(.Value,""))
What do you mean by doesn't work, what happens - error message, wrong results, nothing?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Nothing happens, button is used as per code in link http://www.pcreview.co.uk/threads/se...ng-vb.2070812/ in my first thread.
Using text or value doesn't seem to make any difference.
Works great on mainform.
I can't replicate the issue (works in my db). If you want to provide db for analysis, follow instructions at bottom of my post.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Wait - Button is on main form but you want code to set focus on control in subform?
Set the Code control to be the first in TabOrder.
Then just set focus to the subform container.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Sorted it!
Used, On mouse up event
Private Sub Combo_thisweek_code_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
With Me.Combo_thisweek_code
.SelStart = 0
.SelLength = Len(.Text)
End With
End Sub
Works perfect.
Many thanks for your help
Redkyte