UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Closing form if records = 0    
 
   
louzam2115
post Jan 17 2005, 10:04 AM
Post #1

UtterAccess Addict
Posts: 234



On the main active form I use this code on before insert, and I tried it on after insert to see if this worked.

CODE
If Me.Form.Recordset.RecordCount = 0 Then
DoCmd.Close acForm, "frm_view_property", acSaveNo
DoCmd.OpenForm ("frmnorecordproperty")
End If


I got this to work when I call it to subforms, but for some reason I can not seem to make it to work for the main form.

All help is apprecieated.

Louis
Go to the top of the page
 
+
hazpak
post Jan 18 2005, 12:34 AM
Post #2

UtterAccess Veteran
Posts: 354
From: Australia



I have tried something similar in the past. I assume you are testing the condition on the Onopen procedure? Apparently Access doesn't like you closing the form that its hasnt finished opening yet!

In the end i checked the condition before opening the form when i was about to navigate to it. I'm not sure of your setup so i am not sure if this will help you in anyway.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 20th May 2013 - 12:30 PM