if not isnull then

D

deb

I have a form called fproject.
I have a yes/no (-1/0) option box for the field called LD.
If any of the following fields Est, Potential, Amt) have data then LD is
automatically marked as Yes.

The user can also check yes for LD even if none of the 3 fields do not have
data.

How can I set this up on the form? Something like...

If not isnull([Est]) or not isnull([Potential]) or not isnull([Amt]) then
LD=-1


Thanks in advance,
 
A

Allen Browne

Use the AfterUpdate event procedure of the 3 text boxes to set the yes/no
field (if it's not already set.)

This kind of thing:

Private Sub Est_AfterUpdate()
If Me.LD = False And Not (IsNull(Me.Est) Or IsNull(Me.Potential) Or
IsNull(Me.Amt)) Then
Me.LD = True
End If
End Sub

Private Sub Est_AfterUpdate()
Call Est_AfterUpdate
End Sub

Private Sub Est_AfterUpdate()
Call Est_AfterUpdate
End Sub
 
T

tedmi

Allen: I think your second and third procs should be named:
Potential_AfterUpdate
and
Amt_AfterUpdate
--
TedMi

Allen Browne said:
Use the AfterUpdate event procedure of the 3 text boxes to set the yes/no
field (if it's not already set.)

This kind of thing:

Private Sub Est_AfterUpdate()
If Me.LD = False And Not (IsNull(Me.Est) Or IsNull(Me.Potential) Or
IsNull(Me.Amt)) Then
Me.LD = True
End If
End Sub

Private Sub Est_AfterUpdate()
Call Est_AfterUpdate
End Sub

Private Sub Est_AfterUpdate()
Call Est_AfterUpdate
End Sub
--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

deb said:
I have a form called fproject.
I have a yes/no (-1/0) option box for the field called LD.
If any of the following fields Est, Potential, Amt) have data then LD is
automatically marked as Yes.

The user can also check yes for LD even if none of the 3 fields do not
have
data.

How can I set this up on the form? Something like...

If not isnull([Est]) or not isnull([Potential]) or not isnull([Amt]) then
LD=-1


Thanks in advance,
 
A

Allen Browne

Yes. Thanks.
(Guility of unfixed up copy'n'paste.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

tedmi said:
Allen: I think your second and third procs should be named:
Potential_AfterUpdate
and
Amt_AfterUpdate
--
TedMi

Allen Browne said:
Use the AfterUpdate event procedure of the 3 text boxes to set the yes/no
field (if it's not already set.)

This kind of thing:

Private Sub Est_AfterUpdate()
If Me.LD = False And Not (IsNull(Me.Est) Or IsNull(Me.Potential) Or
IsNull(Me.Amt)) Then
Me.LD = True
End If
End Sub

Private Sub Est_AfterUpdate()
Call Est_AfterUpdate
End Sub

Private Sub Est_AfterUpdate()
Call Est_AfterUpdate
End Sub
deb said:
I have a form called fproject.
I have a yes/no (-1/0) option box for the field called LD.
If any of the following fields Est, Potential, Amt) have data then LD
is
automatically marked as Yes.

The user can also check yes for LD even if none of the 3 fields do not
have
data.

How can I set this up on the form? Something like...

If not isnull([Est]) or not isnull([Potential]) or not isnull([Amt])
then
LD=-1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top