Display combo box list without cursor click

G

Glenn

Does anyone know of a way to display the list of items from a combo box
simply by passing the cursor over the field (as opposed to clicking on the
down arrow within the field...the way it is usually done)?

Thanks.
 
O

Ofer

You might here a better way, and I personally don't like this way , but it's
up to you
============================================
On the OnMouseMove Property of the field run the code
If I = 1 Then
SendKeys "{F4}"
I = 2
End If
===========================================
In the form decleration declare I
Dim I as Integer
===========================================
On the OnMouseMove Property of the form, or a border that you create around
the text box, write the code
I=1
=================================
 
G

Glenn

Ofer,

I do not understand the part of your instructions when you say "In the form
decleration declare I Dim I as Integer". Where does that portion of the code
go?

Thanks.
 
O

Ofer

Go into the code in the form, in any part, press page up until you get to the
top of the page, there is a single line there, after this line you can
declare variable.
Any variable that you declare there will apply to the all form
 
G

Glenn

Ofer,

Thanks for your help with the declarations. I think I've fixed that portion
of the problem. Now, when I return to the form and move the cursor over the
field I get the error message, "Microsoft Office Access can't find the Macro
'I=1'.

Any thoughts?
 
G

Glenn

Ofer, here it is...


Option Compare Database
Dim I As Integer

Private Sub Command26_Click()
On Error GoTo Err_Command26_Click


DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Exit_Command26_Click:
Exit Sub

Err_Command26_Click:
MsgBox Err.Description
Resume Exit_Command26_Click

End Sub
Private Sub Command48_Click()
On Error GoTo Err_Command48_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Exit_Command48_Click:
Exit Sub

Err_Command48_Click:
MsgBox Err.Description
Resume Exit_Command48_Click

End Sub
Private Sub Command76_Click()
On Error GoTo Err_Command76_Click


DoCmd.DoMenuItem acFormBar, acRecordsMenu, 2, , acMenuVer70

Exit_Command76_Click:
Exit Sub

Err_Command76_Click:
MsgBox Err.Description
Resume Exit_Command76_Click

End Sub
Private Sub Excel_Click()
On Error GoTo Err_Excel_Click

Dim oApp As Object

Set oApp = CreateObject("Excel.Application")
oApp.Visible = True
'Only XL 97 supports UserControl Property
On Error Resume Next
oApp.UserControl = True

Exit_Excel_Click:
Exit Sub

Err_Excel_Click:
MsgBox Err.Description
Resume Exit_Excel_Click

End Sub
Private Sub Command96_Click()
On Error GoTo Err_Command96_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "refdate"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command96_Click:
Exit Sub

Err_Command96_Click:
MsgBox Err.Description
Resume Exit_Command96_Click

End Sub

Private Sub Calendar4_Click()

RefDate.Value = Calendar4.Value
RefDate.SetFocus
Calendar4.Visible = False

End Sub

Private Sub Combo278_BeforeUpdate(Cancel As Integer)

End Sub

Private Sub BatToday1_Change()

End Sub

Private Sub BatToday_Change()
Dim T
T = DLookup("[Fee]", "Battery", "[Battery]=forms!Main![BatToday]")
Me![RefAmt] = T
DoCmd.RunCommand acCmdRefresh
End Sub

Private Sub ClientID_AfterUpdate()

End Sub

Private Sub ClientID_BeforeUpdate(Cancel As Integer)
If DCount("*", "Main", "[ClientID] ='" & Me![ClientID] & "'") > 0 Then
MsgBox "This is a duplicate Client ID number. Please assign a different
value."
Cancel = True
End If

End Sub

Private Sub CounLaNa_Change()

Dim A
Dim B
Dim C
Dim D
A = DLookup("[First]", "Counselor", "[Last]=forms!Main![CounLaNa]")
Me![CounFiNa] = A
B = DLookup("[Prefix]", "Counselor", "[Last]=forms!Main![CounLaNa]")
Me![Prefix] = B
C = DLookup("[BVRoff]", "Counselor", "[Last]=forms!Main![CounLaNa]")
Me![BVRoff] = C
D = DLookup("[WhereTst]", "Counselor", "[Last]=forms!Main![CounLaNa]")
DoCmd.RunCommand acCmdRefresh
Me![WhereTst] = D

End Sub

Private Sub CounLaNa_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
If I = 1 Then
SendKeys "{F4}"
I = 2
End If
End Sub


Private Sub Demographics_Click()

End Sub

Private Sub LastNa_BeforeUpdate(Cancel As Integer)

End Sub



Private Sub YearRef_Enter()

End Sub

Private Sub Text264_BeforeUpdate(Cancel As Integer)

End Sub

Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
I = 1
End Sub

Private Sub Form_Current()
Me!ClientID.SetFocus
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single,
Y As Single)
End Sub
 
O

Ofer

Try and Change it from I to something more unique like III

If it doesn't work, try and define it in a module declaretioen as
Global III as Integer
If the combo placed in a subform, it might cause a problem, so define it in
a module.

Your code work fine in my computer


--
I hope that helped
Good luck


Glenn said:
Ofer, here it is...


Option Compare Database
Dim I As Integer

Private Sub Command26_Click()
On Error GoTo Err_Command26_Click


DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Exit_Command26_Click:
Exit Sub

Err_Command26_Click:
MsgBox Err.Description
Resume Exit_Command26_Click

End Sub
Private Sub Command48_Click()
On Error GoTo Err_Command48_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Exit_Command48_Click:
Exit Sub

Err_Command48_Click:
MsgBox Err.Description
Resume Exit_Command48_Click

End Sub
Private Sub Command76_Click()
On Error GoTo Err_Command76_Click


DoCmd.DoMenuItem acFormBar, acRecordsMenu, 2, , acMenuVer70

Exit_Command76_Click:
Exit Sub

Err_Command76_Click:
MsgBox Err.Description
Resume Exit_Command76_Click

End Sub
Private Sub Excel_Click()
On Error GoTo Err_Excel_Click

Dim oApp As Object

Set oApp = CreateObject("Excel.Application")
oApp.Visible = True
'Only XL 97 supports UserControl Property
On Error Resume Next
oApp.UserControl = True

Exit_Excel_Click:
Exit Sub

Err_Excel_Click:
MsgBox Err.Description
Resume Exit_Excel_Click

End Sub
Private Sub Command96_Click()
On Error GoTo Err_Command96_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "refdate"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command96_Click:
Exit Sub

Err_Command96_Click:
MsgBox Err.Description
Resume Exit_Command96_Click

End Sub

Private Sub Calendar4_Click()

RefDate.Value = Calendar4.Value
RefDate.SetFocus
Calendar4.Visible = False

End Sub

Private Sub Combo278_BeforeUpdate(Cancel As Integer)

End Sub

Private Sub BatToday1_Change()

End Sub

Private Sub BatToday_Change()
Dim T
T = DLookup("[Fee]", "Battery", "[Battery]=forms!Main![BatToday]")
Me![RefAmt] = T
DoCmd.RunCommand acCmdRefresh
End Sub

Private Sub ClientID_AfterUpdate()

End Sub

Private Sub ClientID_BeforeUpdate(Cancel As Integer)
If DCount("*", "Main", "[ClientID] ='" & Me![ClientID] & "'") > 0 Then
MsgBox "This is a duplicate Client ID number. Please assign a different
value."
Cancel = True
End If

End Sub

Private Sub CounLaNa_Change()

Dim A
Dim B
Dim C
Dim D
A = DLookup("[First]", "Counselor", "[Last]=forms!Main![CounLaNa]")
Me![CounFiNa] = A
B = DLookup("[Prefix]", "Counselor", "[Last]=forms!Main![CounLaNa]")
Me![Prefix] = B
C = DLookup("[BVRoff]", "Counselor", "[Last]=forms!Main![CounLaNa]")
Me![BVRoff] = C
D = DLookup("[WhereTst]", "Counselor", "[Last]=forms!Main![CounLaNa]")
DoCmd.RunCommand acCmdRefresh
Me![WhereTst] = D

End Sub

Private Sub CounLaNa_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
If I = 1 Then
SendKeys "{F4}"
I = 2
End If
End Sub


Private Sub Demographics_Click()

End Sub

Private Sub LastNa_BeforeUpdate(Cancel As Integer)

End Sub



Private Sub YearRef_Enter()

End Sub

Private Sub Text264_BeforeUpdate(Cancel As Integer)

End Sub

Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
I = 1
End Sub

Private Sub Form_Current()
Me!ClientID.SetFocus
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single,
Y As Single)
End Sub


--
Glenn


Ofer said:
Get in the form code, select all the code (Ctrl+A) copy and post it please
 
Top