cs_ANOUCHKA8686
Messages postés29Date d'inscriptionjeudi 10 avril 2008StatutMembreDernière intervention25 mai 2008
-
13 mai 2008 à 23:39
cs_ANOUCHKA8686
Messages postés29Date d'inscriptionjeudi 10 avril 2008StatutMembreDernière intervention25 mai 2008
-
14 mai 2008 à 19:26
bonjour
Set Ct = New ADODB.Connection
Ct.Provider = "Microsoft.Jet.Oledb.4.0"
Ct.ConnectionString = App.Path & "\ZI.mdb"
Ct.Open
'___________________________________DELEGATION
tmp = Combo4
Select Case tmp
Case "ARIANA"
sql = "select NOM_DELEG from DELEGATION where CODE_GOUV=12"
Case "TUNIS"
sql = "select NOM_DELEG from DELEGATION where CODE_GOUV=11"
Case "BEN AROUS"
sql = "select NOM_DELEG from DELEGATION where CODE_GOUV=13"
Case "MANOUBA"
sql = "select NOM_DELEG from DELEGATION where CODE_GOUV=14"
End Select
Set RcCombo = New ADODB.Recordset
RcCombo.Open sql, Ct, adOpenDynamic
Combo2.Clear
Do Until RcCombo.EOF
Combo2.AddItem RcCombo!NOM_DELEG
RcCombo.MoveNext
Loop
RcCombo.Close
'___________________________________GOUVERNORAT
Set RcCombo = New ADODB.Recordset
RcCombo.Open "SELECT NOM_GOUV FROM GOUVERNORAT ORDER BY NOM_GOUV", Ct, adOpenDynamic
Combo4.Clear
Do Until RcCombo.EOF
Combo4.AddItem RcCombo!NOM_GOUV
RcCombo.MoveNext
Loop
RcCombo.Close
voile mon code , bon avan de metre la boucle case tt marche comme sur des roulettes
mais comme j avai besoin de filtre le contenu de mon conmbo j ai mit cette boucle
mais il me sort toujour le message ' les arguments sont de type incorecte'
cs_ANOUCHKA8686
Messages postés29Date d'inscriptionjeudi 10 avril 2008StatutMembreDernière intervention25 mai 2008 14 mai 2008 à 19:26
bonjour voila j ai un probleme avec le filtre saarche pas , je ne sais pas se qui cloche???
Private Sub Combo2_click()
If Trim$(Combo2.Text) = "" Then Exit Sub
Set RcCombo = New ADODB.Recordset
Set Rc = New ADODB.Recordset
Set newRs = RsEncours.Clone
Rc.Open "DELEGATION", Ct, adOpenDynamic, adLockOptimistic
Rc.Find "NOM_DELEG=" & "'" & Combo2.Text & "'" newRs.Filter ("nom_gouv'" & Combo4 & "'")
Dim recs As MapObjects2.Recordset
Dim shp As Object
Dim rect As MapObjects2.Rectangle
Dim exp As String exp "NOM_DELEG '" & Combo2.Text & "'"
Set recs = Map1.Layers("DELEG"). _
SearchExpression(exp)
End Sub