Combo Box pop up prompt problems

applevacross

Registered User.
Local time
Today, 18:29
Joined
Jul 15, 2005
Messages
17
:confused: I would like to create a popup on my combo box to do the following:

When a serial number is entered and no records are found, it prompts "no matching record/s available" and no controls show data.

Currently, if I enter a serial and no data is found, the control options stay with the current data which doesn't match the serial. Users can't decipher if the search worked.

Any help is greatly appreciated. Thank you all for your expertise!
 
Here's a code you can use. Make sure you replace "Combo74" with the name of your combobox. Also inside the Dcount function, replace the field name and the table name to match yours accordingly.


Sub Combo74_AfterUpdate()
Dim intx As Integer
' Find the record that matches the control.

intx = DCount("[SerialNumber]", "tblSerialNumbers_History", "[SerialNumber] = '" & Me![Combo74] & "'")
If intx < 1 Then
MsgBox "Sorry, record not found", vbInformation
Exit Sub
End If
Me.RecordsetClone.FindFirst "[SerialNumber] = '" & Me![Combo74] & "'"
Me.bookmark = Me.RecordsetClone.bookmark
End Sub
 
Hey, Thank you so much; your kindness and expertise is greatly appreciated!
 

Users who are viewing this thread

Back
Top Bottom