What I'm trying to do is to force the form to open up and load this record when the form is loaded/opened. The structure of the database only allows users to have one draft at once, as it should be dealt with next time the form is opened, so there should only be 1 record in this temporary table that is specific to that user.
I've tried doing:
Expand|Select|Wrap|Line Numbers
- Dim rst As DAO.Recordset
- Dim strCriteria As String
- Set rst = Me.RecordsetClone
- strCriteria = ("[LastEditedBy]='" & GUsername & "'")
- rst.FindFirst (strCriteria)
- If rst.NoMatch Then
- MsgBox "No entry found."
- Else
- Me.Form.Bookmark = Me.RecordsetClone.Bookmark
- End If
I've also tried sticking the criteria into the code for opening the form from the main menu, but again that just opens it to a new record.
I have disabled any old code on the On_Load event that used to tell the form to go to a new record.
Can anyone see something wrong with the code I've used?
Can FindFirst only be used for numerical values? If so, is there an alternative for string based fields?
This seems like such a stupidly simple thing to be stuck on, and yet I can't figure it out!
Thanks.
Adam.