G
Guest
I am using a bound combo box with the Limit to List property turned off. What
I am trying to do is check to see if the user picks a value from the list,
and if he does, set the values of other controls in the form with values from
the table that the combo box is bound to (different fields). I'm trying to
use the After Update event to do this, by searching for the value in the
table using findfirst, and then an if clause based on the NoMatch property. I
keep getting an error that says "Procedure declaration does not match
description of event or procedure having the same name." Below is the code I
have so far (I haven't gotten so far as to update the other values, b/c I
keep getting this error just based on the "find" part):
Private Sub Combo82_AfterUpdate(NewData As String)
Dim rs As DAO.Recordset
Dim strFind as String
Dim StrMessage As String
Set rs = CurrentDb.OpenRecordset("AOIs")
Set strFind = "NAME = '" & NewData & "'"
With rs
varBookmark = .Bookmark
.FindFirst strFind
If .NoMatch Then
strMessage = "No Match Found"
MsgBox strMessage
Else
strMessage = "Match Found"
MsgBox strMessage
End If
End With
End Sub
I am trying to do is check to see if the user picks a value from the list,
and if he does, set the values of other controls in the form with values from
the table that the combo box is bound to (different fields). I'm trying to
use the After Update event to do this, by searching for the value in the
table using findfirst, and then an if clause based on the NoMatch property. I
keep getting an error that says "Procedure declaration does not match
description of event or procedure having the same name." Below is the code I
have so far (I haven't gotten so far as to update the other values, b/c I
keep getting this error just based on the "find" part):
Private Sub Combo82_AfterUpdate(NewData As String)
Dim rs As DAO.Recordset
Dim strFind as String
Dim StrMessage As String
Set rs = CurrentDb.OpenRecordset("AOIs")
Set strFind = "NAME = '" & NewData & "'"
With rs
varBookmark = .Bookmark
.FindFirst strFind
If .NoMatch Then
strMessage = "No Match Found"
MsgBox strMessage
Else
strMessage = "Match Found"
MsgBox strMessage
End If
End With
End Sub