Using if is null

NickNeville

Registered User.
Local time
Today, 14:24
Joined
May 17, 2009
Messages
119
Could anyone help with a piece of coding please.

I am trying to enter on a subform an "if Isnull" which refers to a control
on the main form.
Like
If IsNull (mainform!member) then messagebox etc

But cannot get the sequence correct. Can anyone help me please.

Rgds
nick
 
Use

Code:
If IsNull(Me.ControlName) Then
   Do This
Else
   Do That
End If
 
Code:
If IsNull(Me.Parent.Member) Then
    Msgbox "Hurrah!"
End If
Where are you putting this code?
 
thanks for your quick reply
I am placing it in a "got focus" control in the sub form.

This ok ?

Rgds
nick
 
It could be, but why have you thought of putting it in that event?
 
Hi
Well I have a subform which when entered into or got focus I wanted to refer to a control on the main form.
Like
If IsNull (Me.Main form.Memrenewal) then
msg box Etc

But the code doesn't seem to want to work so far.

Nick
 
I actually said Me.Parent.Member and not Me.MainForm.Member

If you want it on the got focus then you're using the right event.

What is the name of the subform control?
 
OOOH Aha !
That's a new one on me, I've always referred to a sub form (the other way round)
I thought that you were referring to any "parent or Main form"

Now all is clear
Thanks very very mucho for your patience

Bets rgds
Nick
 

Users who are viewing this thread

Back
Top Bottom