View Full Version : Pop Up Form problems


LisaP
02-16-2001, 05:07 AM
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.......

Rich
02-16-2001, 05:19 AM
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
02-16-2001, 05:30 AM
Thanks Rich, it worked a treat!