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