By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,573 Members | 3,017 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,573 IT Pros & Developers. It's quick & easy.

How do I open "Employee Detail" from "Project List"

P: 1
Hi, I've been very frustrated for 2 days trying to make this work. I started with a built-in template "Projects" that came with Access 2007. On the "Employee List" I can click on any cell and bring up the Employee Detail" corresponding to that particular cell. That works fine. I want to be able to open "Employee Detail" when I click on a cell in "Project Detail". I got to the point that "Employee Detail" opens but only to the frst record. PLEASE help!

Here’s the code for double clicking on any cell in “employee list”. This works!
Function macro5()

DoCmd.OpenForm "Employee Details", acNormal, "", "[ID]=" & .ID, , acDialog
TempVars.Add "CurrentID", "[ID]"
DoCmd.Requery ""
DoCmd.SearchForRecord , "", acFirst, "[ID]=" & TempVars!CurrentID
TempVars.Remove "CurrentID"

Exit Function

Here is the VBA Code for double clicking on the “Principal in Charge”. I added the message box to see which record is shown.
Dim curr_rec As String

Private Sub Principal_in_Charge_DblClick(Cancel As Integer)
curr_rec = [Principal in charge]
DoCmd.OpenForm FormName:="employee details"
Forms![employee details].SetFocus
DoCmd.GoToRecord , , acGoTo, curr_rec
MsgBox (curr_rec)
End Sub
Mar 20 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.