If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
Access 2003 mouse down property code problem
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? |
#2
|
|||
|
|||
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? |
Thread Tools | |
Display Modes | |
|
|