J
Jack Sheet
Code behind a combo box used for selecting records in a form reads as
follows:
Option Compare Database
Option Explicit
Private Sub Form_Current()
Combo28 = Null
End Sub
Sub Combo28_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[ID_Tasks] = " & Me![Combo28]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub
Other Combo box properties that may be relevant are
"Limit to list" = yes
"Enabled" = yes
"Locked" = no
In the Form properties:
"Allow Filters" = yes
"Allow Edits" = yes
"Allow Deletions" = yes
"Allow Additions" = no
"Data Entry" = no
Problem:
The form seems to operate pretty much as desired with the following
exception.
If the user types in a reference in the combo box, then changes his mind, it
works fine if he hits escape key, but if instead he back-spaces over the
typed characters and then hits Enter or Tab I get
Run Time Error 3077
Sytax Error (missing operator) in expression
with the following expression highlighted on hitting Debug:
Me.RecordsetClone.FindFirst "[ID_Tasks] = " & Me![Combo28]
If I then click "End" on the error message prompt everything proceeds
smoothly, but I would rather disable the error message in that instance.
Any takers? Thanks
follows:
Option Compare Database
Option Explicit
Private Sub Form_Current()
Combo28 = Null
End Sub
Sub Combo28_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[ID_Tasks] = " & Me![Combo28]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub
Other Combo box properties that may be relevant are
"Limit to list" = yes
"Enabled" = yes
"Locked" = no
In the Form properties:
"Allow Filters" = yes
"Allow Edits" = yes
"Allow Deletions" = yes
"Allow Additions" = no
"Data Entry" = no
Problem:
The form seems to operate pretty much as desired with the following
exception.
If the user types in a reference in the combo box, then changes his mind, it
works fine if he hits escape key, but if instead he back-spaces over the
typed characters and then hits Enter or Tab I get
Run Time Error 3077
Sytax Error (missing operator) in expression
with the following expression highlighted on hitting Debug:
Me.RecordsetClone.FindFirst "[ID_Tasks] = " & Me![Combo28]
If I then click "End" on the error message prompt everything proceeds
smoothly, but I would rather disable the error message in that instance.
Any takers? Thanks