Misty R
asked on
Access runtime error 3251 operation not supported
WindowsXP, Access 2003, novice user.
I have an unbound form.
I've written my code as follows:
Private Sub txtUniqueName_AfterUpdate( )
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("h stUser")
rst.FindFirst "[UniqueName] = " & Me.txtUniqueName
If rst.NoMatch Then
MsgBox "No match found on file", vbOKOnly
Else
MsgBox "Unique Name already on file", vbOKOnly
End If
Set rst = Nothing
End Sub
My problem is when I tab out of the text box I get the error msg
RUNTIME ERROR 3251 OPERATION IS NOT SUPPORTED FOR THIS TYPE OF OBJECT
the line
rst.FindFirst "[UniqueName] = " & Me.txtUniqueName is highlighted when i click on debug.
I do not know if I am getting this error because my form is unbound and maybe after_update is not the appropriate event or if there is something else I am doing wrong.
Thanks in advance for assistance.
Misty
I have an unbound form.
I've written my code as follows:
Private Sub txtUniqueName_AfterUpdate(
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("h
rst.FindFirst "[UniqueName] = " & Me.txtUniqueName
If rst.NoMatch Then
MsgBox "No match found on file", vbOKOnly
Else
MsgBox "Unique Name already on file", vbOKOnly
End If
Set rst = Nothing
End Sub
My problem is when I tab out of the text box I get the error msg
RUNTIME ERROR 3251 OPERATION IS NOT SUPPORTED FOR THIS TYPE OF OBJECT
the line
rst.FindFirst "[UniqueName] = " & Me.txtUniqueName is highlighted when i click on debug.
I do not know if I am getting this error because my form is unbound and maybe after_update is not the appropriate event or if there is something else I am doing wrong.
Thanks in advance for assistance.
Misty
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
as above code, I tested it, and it seems working.
you need to add dbOpenDynaset in this line Set rst = CurrentDb.OpenRecordset("h stUser",db OpenDynase t)
and change this line to rst.FindFirst "[UniqueName] = '" & Me.txtUniqueName & "'"
you need to add dbOpenDynaset in this line Set rst = CurrentDb.OpenRecordset("h
and change this line to rst.FindFirst "[UniqueName] = '" & Me.txtUniqueName & "'"
ASKER
Thanks to you both, the solution provided did work when I tested it on my form.
ASKER