By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,466 Members | 2,523 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,466 IT Pros & Developers. It's quick & easy.

stop form opening

P: n/a
hi
is it possible to stop a form opening if the result of the query is
null?

eg
select a company name from a combobox if the name is not in the table
(ie the query returns null) can i stop the form opening
thanks

kevin

Jan 24 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 24 Jan 2006 07:21:07 -0800, "kevcar40" <ke******@btinternet.com> wrote:
hi
is it possible to stop a form opening if the result of the query is
null?

eg
select a company name from a combobox if the name is not in the table
(ie the query returns null) can i stop the form opening
thanks

kevin


The form's OnOpen event has a cancel argument. Putting
Cancel = True in this event will stop the form opening. So -

Sub Form_Open()

If *Records Check Fails* Then
Cancel = True
End If

End Sub
Wayne Gillespie
Gosford NSW Australia
Jan 24 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.