W
Webtechie
Hello,
I am trying to populate a user form.
I've got to where I can populate the userform fields using a recordset. Now
I need the user to be able to get to the next record.
I have a spin control on the form. When they press up or down, I need the
recordset to advance and the text fields to show the next record.
I tried to save the bookmark of the recordset to a hidden field.
But when I try to set the bookmark, I'm getting an error message. I'm
getting a "False" when I try to set the bookmark.
Anyone have an idea of why I am getting an error message?
Set rsGuestData = New ADODB.Recordset
'Is connection open?
'*******************
If myConnection Is Nothing Then
ConnectToDatabase
End If
'Get connection from the pool
'****************************
myConnection.Open
'Create SQL Statement
'********************
mySQL = "select * from tblGuest " _
& " where employeeid = " & thisEmployeeID _
& " and deptID = " & thisDeptID
With rsGuestData
.CursorLocation = adUseClient
.Open mySQL, myConnection, adOpenDynamic, adLockOptimistic
.Bookmark = frmMyUserForm.spnDataEntry.Value
End If
End With
Thanks
Tony
I am trying to populate a user form.
I've got to where I can populate the userform fields using a recordset. Now
I need the user to be able to get to the next record.
I have a spin control on the form. When they press up or down, I need the
recordset to advance and the text fields to show the next record.
I tried to save the bookmark of the recordset to a hidden field.
But when I try to set the bookmark, I'm getting an error message. I'm
getting a "False" when I try to set the bookmark.
Anyone have an idea of why I am getting an error message?
Set rsGuestData = New ADODB.Recordset
'Is connection open?
'*******************
If myConnection Is Nothing Then
ConnectToDatabase
End If
'Get connection from the pool
'****************************
myConnection.Open
'Create SQL Statement
'********************
mySQL = "select * from tblGuest " _
& " where employeeid = " & thisEmployeeID _
& " and deptID = " & thisDeptID
With rsGuestData
.CursorLocation = adUseClient
.Open mySQL, myConnection, adOpenDynamic, adLockOptimistic
.Bookmark = frmMyUserForm.spnDataEntry.Value
End If
End With
Thanks
Tony