djoao
Messages postés17Date d'inscriptionsamedi 1 mai 2004StatutMembreDernière intervention 8 février 2007
-
9 mai 2005 à 17:16
djoao
Messages postés17Date d'inscriptionsamedi 1 mai 2004StatutMembreDernière intervention 8 février 2007
-
9 mai 2005 à 18:56
bonjour à tous
voila j'ai un probleme avec les findfirst, findnext ,....
je fais tout manuellement (je n'utilise pas de datacontrol)
donc voila j'ai déclarer mes variables:
Dim db As dao.Database
Dim MonJeu As dao.Recordset
tout marche(ajout de record , suppression,...)
mais quand je veux utiliser les findnext j'ai un msg d'erreur:
run-time error '3251'
opération non autorisée pour cetype d'objet
voila ma ligne pour la recherche:
MonJeu.FindFirst (cbRecherche.Text & " = '" & edtRecherche.Text & "'")
cbRecherche: contient le nom des champs de la table
edtRecherche:contient la chaine recherchée.
Set DB = gwsMainWS.OpenDatabase("C:\Documents and Settings\paul\Bureau\Comptoir.mdb", False, gnReadOnly, "")
'Ne fonctionne pas averc la funtion FindFirst
'Set RS = DB.OpenRecordset("Clients", dbOpenDynaset)
Set RS = DB.OpenRecordset("SELECT DISTINCTROW * FROM [Clients]")
RS.FindFirst "[Code client] Like 'ALFKI'"
If RS.NoMatch Then
MsgBox "pas d'enregistrement"
else
'Changer l'index en fonction de votre recherche
MsgBox RS.Fields(1)
End If
RS.Close
DB.Close