Dreamweaver
Well-known member
- Local time
- Today, 03:49
- Joined
- Nov 28, 2005
- Messages
- 2,466
I'm adding two pictures for this It's something I've been trying to work out for ever.
I built this with help from a book back in 2000 This it was the developers hand book.
At the moment the bottom list is limited to 28 employees if you look at the second Image below
You can see I have got around the problem by adding a department limit but yes I would still want to keep that limitor and will add it to the project manager project but What I really want to do is display in the bottom list 28 employees but the active one must be in the default 28 then have a back or fowards button so I can move to the next 28 or back as the case may be.
I have updated this with a diary in the employee example but I like this one
This is the code The Department limit list uses hope somebody can help me
I built this with help from a book back in 2000 This it was the developers hand book.
At the moment the bottom list is limited to 28 employees if you look at the second Image below
You can see I have got around the problem by adding a department limit but yes I would still want to keep that limitor and will add it to the project manager project but What I really want to do is display in the bottom list 28 employees but the active one must be in the default 28 then have a back or fowards button so I can move to the next 28 or back as the case may be.
I have updated this with a diary in the employee example but I like this one
This is the code The Department limit list uses hope somebody can help me
SQL:
Public Sub GetData(Opt As Integer, Optional Dep As Long)
'==========================================================================
'Project : Disc Jocky 2000 V 0.1
'Description : Updates Controls on form Depending on Crosstab
'Called By : Tab Control On Change
'Calls : None
'Parameters : None
'Returns : None
'Author : Michael Javes
'Date Created : 20-05-01
'Rev. History :Added to DPM And Updated
'Comments :
'==========================================================================
Dim IntColumnCount As Integer 'Count Of Entrys In Employees Table
Dim IntCountControls As Integer 'Total Controls Will Be 14 But Use Count For Adding Controls Latter
Dim I As Integer 'Used In Loop
Dim m_RecQry As DAO.Recordset 'The Recordset for Crosstab Data
Dim StrName As String
Dim m_Db As Database 'Current Database Object
Dim Zfrm As Form, Rfrm As Recordset
Dim StrSQL As String
Dim Slts As DAO.Recordset, SltSQL As String
On Error Resume Next
Set Zfrm = Me.ZfrmDiaryEmpsSubform.Form
Set Rfrm = Me.ZfrmDiaryEmpsSubform.Form.RecordsetClone
Set m_Db = CurrentDb()
'Clear Old Data
DoCmd.SetWarnings False
DoCmd.OpenQuery "QryDiaryDeleteTemps"
DoCmd.OpenQuery "QryDiaryAppendTimes"
DoCmd.SetWarnings True
Zfrm.Requery
SltSQL = Null
'int([DateEntered])=" & Format(Me![txtFrom], "\#" & StrDateFormatExtra & "\#")
SltSQL = " AND int([SlotDate])=" & Format(Me![CtlDate].Value, "\#mm/dd/yyyy\#")
Select Case Me![cboDepartment].Column(2)
Case "D"
If Opt = 2 And Not IsMissing(Dep) Then StrSQL = " AND [DepartmentID]=" & Dep
Set m_RecQry = m_Db.OpenRecordset("Select * FROM tblEmployees WHERE ListDiary=True" & StrSQL, dbOpenSnapshot)
Case "G"
Set m_RecQry = m_Db.OpenRecordset("Select * FROM QryDiaryEmployeesGroups WHERE [GroupID]=" & Me![cboDepartment], dbOpenSnapshot)
End Select
m_RecQry.MoveLast
m_RecQry.MoveFirst
'Get The Count for the Header section Controls
IntColumnCount = m_RecQry.RecordCount + 1
'Now Count The Control
IntCountControls = Zfrm.Detail.Controls.Count - 1
'Turn Of Sreen UpDates
Me.Painting = False
'Reset All Coloumns
For I = 1 To IntColumnCount
If I > 1 Then
Zfrm.Controls("lbl" & I).Caption = "Column" & I
Zfrm.Controls("lbl" & I).Tag = ""
End If
Next I
'Reset Control To Visable
For I = 1 To IntCountControls - 1
Zfrm.Controls("lbl" & I).Visible = True
Zfrm.Controls("txt" & I).Visible = True
Next I
'Fill In The Information For Controls
'Miss First One
For I = 1 To IntColumnCount
If I > 1 Then
Zfrm.Controls("lbl" & I).Caption = m_RecQry("EmpName")
Zfrm.Controls("lbl" & I).Tag = m_RecQry("EmpID")
'Fill The Controls With Details If Any
Set Slts = m_Db.OpenRecordset("SELECT * FROM QryDiaryGetSlots WHERE [Employee]=" & m_RecQry("EmpID") & SltSQL, dbOpenSnapshot)
Do While Not Slts.EOF
Rfrm.FindFirst "TimeID=" & Slts("TimeID")
If Not Rfrm.NoMatch Then
Rfrm.Edit
Rfrm("EMP" & I - 1) = Slts("SlotTime")
Zfrm.Controls("txt" & I).Tag = m_RecQry("EmpID")
Rfrm.Update
End If
Slts.MoveNext
Loop
m_RecQry.MoveNext
End If
Next I
'Now Hide Rest Of Controls
For I = IntColumnCount + 1 To IntCountControls
Zfrm.Controls("lbl" & I).Visible = False
Zfrm.Controls("txt" & I).Visible = False
Next I
m_RecQry.Close
'Now Update Form
Me.Painting = True
End Sub