Pop Up Form problems (1 Viewer)

LisaP

Registered User.
Local time
Today, 08:48
Joined
Nov 13, 2000
Messages
27
Help,

On my main form I have a text box [SN], on the lost focus event, I have a macro which opens a popup form with a where condition - thus will show previous records for that particular SN.

My problem is when there are no previous records for that SN, the pop up form opens and all the controls are hidden!! As you can imagine is rather annoying. I know that on a report there is a On No Data event, but does anyone know the best way to go about this??

Basically if there are no previous records with matching SN, then I dont want the pop up form to display.

Grrrrrr.......
 
R

Rich

Guest
Try adding the following tothe on open event of your form
If RecordsetClone.RecordCount = 0 Then
Cancel = True
Beep
MsgBox "Any message you like", vbOKOnly
End If
 

LisaP

Registered User.
Local time
Today, 08:48
Joined
Nov 13, 2000
Messages
27
Thanks Rich, it worked a treat!
 

Users who are viewing this thread

Top Bottom