[VBA Access 2000] Problème de recordset
Bonjour à tous,
mon problème est très simple, la ça marche :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| Dim cnn1 As ADODB.Connection
Set cnn1 = CurrentProject.Connection
Dim myrecordset As New ADODB.Recordset
Dim madate As Date
myrecordset.ActiveConnection = cnn1
myrecordset.Open "select nNCR from tabNCR where nNCR='" & txtNCR.Value & "'"
Do While myrecordset.EOF = False
If myrecordset.Fields(0) = txtNCR.Value Then
.
.
. |
Et la ça ne marche pas :
Code:
1 2 3 4 5 6 7 8 9 10 11 12
| Dim cnn1 As ADODB.Connection
Set cnn1 = CurrentProject.Connection
Dim myrecordset As New ADODB.Recordset
'ouverture du recordset pour tester si l'utilisateur qui ouvre l'application est déjà connu
myrecordset.ActiveConnection = cnn1
myrecordset.Open "select login from approv where login='" & Environ("USERNAME") & "'"
If IsNull(myrecordset.Fields(0)) Then
.
.
. |
Il n'y a pas d'erreur à l'exécution mais en pas à pas quand on survole myrecordset c'est marqué
Code:
myrecordset = <variable objet ou variable de bloc with non définie>
Franchement je vois pas pourquoi ça ne marche pas, le code s'éxécute sur form_open, la référence ADO est bien coché...
Une idée ?