L
lmcc007
I have an unbound combo box called cboSearch. I am trying to get it to do
five things:
1. When I click cboSearch, display a list of Email Numbers to choose from.
2. After I make a selection, search to see if there is a record using that
Email Number for this company.
3. If no match, display a message box: “Create new e-mail?â€
4. If I choose yes, puts the Email Number selected in lblEmailNum and
display a blank record for me to enter data.
5. If I choose no, do nothing.
Private Sub cboSearch_Change()
Dim rs
Set rs = Me.Recordset.Clone
rs.FindFirst "[EmailNumID] = " & Me![cboSearch]
'If Not rs.EOF Then Me.Bookmark = rs.Bookmark
If rs.NoMatch Then
MsgBox ("Create new e-mail?"), vbOKOnly
Me.EmailAddress = NewRecord
Else
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
'End If
End If
End Sub
The lblEmailNum label doesn’t change to the one selected and there is 0
(zero) in the EmailAddress field.
I don’t see what I am doing wrong? Need help! Thanks!
five things:
1. When I click cboSearch, display a list of Email Numbers to choose from.
2. After I make a selection, search to see if there is a record using that
Email Number for this company.
3. If no match, display a message box: “Create new e-mail?â€
4. If I choose yes, puts the Email Number selected in lblEmailNum and
display a blank record for me to enter data.
5. If I choose no, do nothing.
Private Sub cboSearch_Change()
Dim rs
Set rs = Me.Recordset.Clone
rs.FindFirst "[EmailNumID] = " & Me![cboSearch]
'If Not rs.EOF Then Me.Bookmark = rs.Bookmark
If rs.NoMatch Then
MsgBox ("Create new e-mail?"), vbOKOnly
Me.EmailAddress = NewRecord
Else
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
'End If
End If
End Sub
The lblEmailNum label doesn’t change to the one selected and there is 0
(zero) in the EmailAddress field.
I don’t see what I am doing wrong? Need help! Thanks!