SetFocus to ComboBox, please help !

  • Thread starter Thread starter Clau
  • Start date Start date
C

Clau

I have a form (loan) where I have a ComboBox (BookCode) and in that
combobox I´ve created the following event:

Option Explicit
Option Compare Database

Private Sub BookCode_BeforeUpdate(Cancel As Integer)
If Status = "Lent" Then
MsgBox "The book is not available"
End If
End Sub


so far this works, but I need to add a setfocus to fix the mouse pointer
to the ComboBox and I have no clue on how to continue... someone suggessted
to add:

Me.BookCode.SetFocus

and I added it before the End If... but it didn´t work....


Can anyone help ???
 
"...fix the mouse pointer to the ComboBox."

If this really does mean that you want to place the acutal mouse pointer
icon on the combo box, I don't think there's any way to do that. SetFocus
just means that the text entry cursor will appear in the box and typing will
begin there.

That code SHOULD work. If it doesn't, I don't know why not.

Good luck

-ndalton
 
Thanks for the info,

Ok, then how can I program it so the cursor doesn´t allow to go to the next
fiel (by tab or click) until the BookCode selection changes to an "Available"
one...

Please this is very important....
"...fix the mouse pointer to the ComboBox."

If this really does mean that you want to place the acutal mouse pointer
icon on the combo box, I don't think there's any way to do that. SetFocus
just means that the text entry cursor will appear in the box and typing will
begin there.

That code SHOULD work. If it doesn't, I don't know why not.

Good luck

-ndalton
I have a form (loan) where I have a ComboBox (BookCode) and in that
combobox I´ve created the following event:
[quoted text clipped - 17 lines]
Can anyone help ???
 
Check my reply to your other post

http://www.microsoft.com/office/com...cess&mid=96858ca3-ccd2-47f4-9a80-d5cbe63877fe

--
Good Luck
BS"D


Clau said:
Thanks for the info,

Ok, then how can I program it so the cursor doesn´t allow to go to the next
fiel (by tab or click) until the BookCode selection changes to an "Available"
one...

Please this is very important....
"...fix the mouse pointer to the ComboBox."

If this really does mean that you want to place the acutal mouse pointer
icon on the combo box, I don't think there's any way to do that. SetFocus
just means that the text entry cursor will appear in the box and typing will
begin there.

That code SHOULD work. If it doesn't, I don't know why not.

Good luck

-ndalton
I have a form (loan) where I have a ComboBox (BookCode) and in that
combobox I´ve created the following event:
[quoted text clipped - 17 lines]
Can anyone help ???
 
Clau said:
I have a form (loan) where I have a ComboBox (BookCode) and in that
combobox I´ve created the following event:

Option Explicit
Option Compare Database

Private Sub BookCode_BeforeUpdate(Cancel As Integer)
If Status = "Lent" Then
MsgBox "The book is not available"
End If
End Sub


so far this works, but I need to add a setfocus to fix the mouse pointer
to the ComboBox and I have no clue on how to continue... someone suggessted
to add:

Me.BookCode.SetFocus

and I added it before the End If... but it didn´t work....


You can just set the Cancel argument to True to prevent the
focus from moving to another control.
 
Back
Top