Trop peu de paramètres attendu : 4 attendu vba access

Fermé
bithack Messages postés 129 Date d'inscription mercredi 29 octobre 2014 Statut Membre Dernière intervention 16 mars 2016 - 30 juil. 2015 à 15:41
Bonjour à tous je viens de nouveau a vous la communauté ccm :)
Voila je réalise un code en vba qui agit lors d'un clique sur un bouton. Il exécute une requête sql qui comprend 2 bases. cette requête me permet de remplir un formulaire :)
je vous mets mon code et vous remercie de votre aide précieuse !!!!
Private Sub Ctl_Editions_LJ_Click()
On Error GoTo Err_Ctl_Editions_LJ_Click

Dim stDocName As String
Dim variable1 As String
Dim variable2 As String
Dim variable3 As String
Dim variable4 As String
Dim variable5 As String
Dim reqedition As String




variable1 = InputBox("date de début")
variable2 = InputBox("date de fin")
variable3 = InputBox("Saisissez LJD pour LJ Directes, Suite RJ pour Conversion,ou *ret* pour retour impayé et * pour Tout")
variable4 = InputBox("saisissez b*, pour bodac ou bodacc, a* pour altares et * pour tout")

'MsgBox variable1
'MsgBox variable2
'MsgBox variable3
'MsgBox variable4


reqedition = " SELECT [histo st omer identifiés].RCS,[histo st omer identifiés].[N° CLIENT],[histo st omer identifiés].Region,[histo st omer identifiés].[Mdate effet],[histo st omer identifiés].[Dénomination officielle],[histo st omer identifiés].[code département],[histo st omer identifiés].[Libellé type de jugement],[histo st omer identifiés].[code origine du jugement],[histo st omer identifiés].[Nom de l'adm judiciaire 1],[histo st omer identifiés].[No rue adm judiciaire 1],[histo st omer identifiés].[lettre dans la rue adm judiciaire 1], [histo st omer identifiés].[voie adm judiciaire 1]," & _
" [histo st omer identifiés].[Complément postal adm judiciaire 1], [histo st omer identifiés].[acheminement postal adm judiciaire 1], [histo st omer identifiés].[code département adm judiciaire 1], [histo st omer identifiés].[libellé fonction adm judiciaire 2], [histo st omer identifiés].[Nom de l'adm judiciaire 2], [histo st omer identifiés].[Complément d'adresse adm judiciaire 2], [histo st omer identifiés].[no rue adm judiciaire 2]," & _
" [histo st omer identifiés].[lettre dans la rue adm judiciaire 2], [histo st omer identifiés].[voie adm judiciaire 2], [histo st omer identifiés].[Complément postal adm judiciaire 2], [client ft].[Date de suspension], [client ft].[Date de résiliation], [client ft].[montant déclaré LJ], [client ft].[montant déclaré RJ], [client ft].commentaires, [client ft].[agent cession], [histo st omer identifiés].[MDate publication]" & _
" FROM [histo st omer identifiés] INNER JOIN [client ft] ON [histo st omer identifiés].Clé = [client ft].Clé" & _
" WHERE (([histo st omer identifiés].[MDate publication]) > variable1) AND (([histo st omer identifiés].[MDate publication]) < variable2) and (([histo st omer identifiés].[Libellé type de jugement]) = variable3) AND (([histo st omer identifiés].[code origine du jugement]) = varaible4 Or [histo st omer identifiés].[code origine du jugement] Is Null);"

CurrentDb.OpenRecordset (reqedition)

stDocName = "Editions des LJ à traiter"
DoCmd.OpenReport stDocName, acPreview

Exit_Ctl_Editions_LJ_Click:
Exit Sub