Populate a form from a double click

robcrussiii

Registered User.
Local time
Today, 05:16
Joined
Mar 1, 2005
Messages
12
I have a form that my users sign out on with thier name, dateout, timeout, datein, timein, reason... Also on this form I have a list box that runs a query to show people currently out of the office. I am trying to make the form populate the sign out information of a person when you double click thier name from the 'currently out' list. Im not having alot of luck. I cant seem to get it to pull in the correct/any recordset. Below is the code I am trying to use to perform this action. Anyone give me some advice on where I am going wrong?



Private Sub Outlist_DoubleClick(Cancel As Integer)

Dim ctlEmpName As Control
Dim ctlOutList As Control

Set ctlEmpName = Me!EmpName
Set ctlOutList = Me!OutList

Me!EmpName.RowSource = "SELECT EmpID, EmpName FROM tblEmployees WHERE EmpID = forms!frmSignOut.OutList ORDER BY EmpName;"

ctlEmpName.Requery
Me.Refresh


End Sub
 
Last edited:
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.FindFirst "EmpName = " & Me.OutList & '"'
Me.Bookmark = rs.Bookmark
 
Thanks for the reply DALeffler. Im confused about this line of code and Im getting a error in my script with it (User define type not defined)

rs.FindFirst "EmpName = " & Me.OutList & '"'

I am very novice at vb, and access for that matter. Trying to expand my knowledge, could you explain what this line does?
 

Users who are viewing this thread

Back
Top Bottom