Connecting Tech Pros Worldwide Help | Site Map

stop form opening

kevcar40
Guest
 
Posts: n/a
#1: Jan 24 '06
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

Wayne Gillespie
Guest
 
Posts: n/a
#2: Jan 24 '06

re: stop form opening


On 24 Jan 2006 07:21:07 -0800, "kevcar40" <kevcar40@btinternet.com> wrote:
[color=blue]
>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[/color]

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
Closed Thread