C
CrazyHorse
Here is my problem and it may be 2 fold. I guess I am using coding from 97
which does not always seem to work with 2000.
1) My "Recordset" declaration does not seem to be valid, since it does not
capitalize the method recordset. It does not give me any errors but it is
odd that it puts it in lower case.
2) I have a form that is linked to a table. I have added a button that
prompts for userName to search for. Once found it should populate the fields
with the record located. I know the record is in there and that it finds it
since the .Nomatch is false. I have also tried bookmarks as you can see
below. Don't know what else to try.
Dim dbCurrent As Database
Dim rsUser As DAO.recordset
Set dbCurrent = CurrentDb
Set rsUser = dbCurrent.OpenRecordset("tUsers", dbOpenDynaset)
Dim user As String
Dim errormsg As String
Dim myBookMark As Variant
user = InputBox("Enter user profile to edit: ")
user = "[UserName] = '" & user & "'"
rsUser.FindFirst user
If rsUser.NoMatch = True Then
errormsg = MsgBox("User not found", vbOKOnly)
Else
Me.Refresh
myBookMark = rsUser.Bookmark
rsUser.Bookmark = myBookMark
Me.Refresh
End If
which does not always seem to work with 2000.
1) My "Recordset" declaration does not seem to be valid, since it does not
capitalize the method recordset. It does not give me any errors but it is
odd that it puts it in lower case.
2) I have a form that is linked to a table. I have added a button that
prompts for userName to search for. Once found it should populate the fields
with the record located. I know the record is in there and that it finds it
since the .Nomatch is false. I have also tried bookmarks as you can see
below. Don't know what else to try.
Dim dbCurrent As Database
Dim rsUser As DAO.recordset
Set dbCurrent = CurrentDb
Set rsUser = dbCurrent.OpenRecordset("tUsers", dbOpenDynaset)
Dim user As String
Dim errormsg As String
Dim myBookMark As Variant
user = InputBox("Enter user profile to edit: ")
user = "[UserName] = '" & user & "'"
rsUser.FindFirst user
If rsUser.NoMatch = True Then
errormsg = MsgBox("User not found", vbOKOnly)
Else
Me.Refresh
myBookMark = rsUser.Bookmark
rsUser.Bookmark = myBookMark
Me.Refresh
End If