Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Procedure If with a IsNull always False

Status
Not open for further replies.

Dabee

Technical User
Aug 4, 2003
2
FR
Sorry if i'm not perfectly clear but this problem had put a spell on me...

The following code is on the event AfterUpdate of a ListBox (named Modifiable1) : When you choose a valor in the listBox, it should open a first report (named FORM_CONSULTATION_CLI) (the ListBox value specify where open : [N_CLI]=[Modifiable1])
Then a procedure If to open a second report. And this if the Modifiable1 value do not correspond at the first report FORM_CONSULTATION_CLI but at a second one FORM_CONSULTATION_PROSP+OLDCLI.
The problem is that my procedure is always executed as False so if Modifiable1 is a value which need my second report to be display it doesn't work and i obtain a blank first report...
My ListBox is generated by a union query between the two tables (TAB_CLI and TAB_PROSP+OLDCLI) used for generated the two reports consequently (FORM_CONSULTATION_LI and FORM_CONSULTATION_PROSP+OLDCLI)


The code is :

open : N_CLI=
Private Sub Modifiable1_AfterUpdate()
DoCmd.OpenForm "FORM_CONSULTATION_CLI", acNormal, "", "[N_CLI]=[Formulaires]![FORM_CONSULTATION_MENU]![Modifiable1]"
If IsNull(Forms("FORM_CONSULTATION_CLI").N_CLI) Or Forms("FORM_CONSULTATION_CLI").N_CLI = "" Then
DoCmd.Close acForm, "FORM_CONSULTATION_CLI"
DoCmd.OpenForm "FORM_CONSULTATION_PROSP+OLDCLI", acNormal, "", "[N_CLI]=[Formulaires]![FORM_CONSULTATION_MENU]![Modifiable1]", , acNormal
End If
End Sub
 
Did you try replacing IsNull with [FIELD]=""?

Jim DeGeorge [wavey]
 
You may also want to try setting your IsNull([expression]) equal to True. This may help.
 
My problem is away, Thx for your help

I have use a Dlookup wich is more useful in my code (off course it works well know)

Thx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top