View Single Post
  #2  
Old May 13th, 2009, 04:59 PM posted to microsoft.public.access.tablesdbdesign
Maarkr
external usenet poster
 
Posts: 240
Default Access 2003 mouse down property code problem

why not just use Me!Combo29 = Null instead of Me!Combo29.ForeColor = 16777164
?


"Bob Waggoner" wrote:

I have a combo box that I use to quickly find a record. I want the lookup
list name to disappear after use (not the combo box, just the name that was
selected), so I set the forecolor property to the backcolor property in the
after update property. (This works in Access 97.) When I try to restore the
forecolor property to 0 (black) if the user needs to change records using the
On Mouse Down event, the lookup no longer finds the record. Here's my code:

Private Sub Combo29_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[LiAttendeesID] = " & Str(Nz(Me![Combo29], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
Me!Combo29.ForeColor = 16777164
End Sub

On Mouse Down property:

Private Sub Combo29_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Me!Combo29.ForeColor = 0
End Sub

If I remove the On Mouse Down code, the look up works.

What do I need to do to fix this?