Hello all,
I've written an application that takes care of our employees working hours.
It was developed using MSACCESS 2003 and running under both the full version of access and run time version.
Everything works fine under the full version, but there is a piece of code that causes an error under Run Time version.
Here is the code :
Private Sub btnHistory_Click()
Dim ssql1, nm As String
Dim rs As ADODB.Recordset
Dim x, i As Integer
Set rs = CreateObject("ADODB.Recordset")
ssql1 = "SELECT Count(Query1.DateOfReport) AS CountOfDateOfReport, Query1.Employee, Query1.Project"
ssql1 = ssql1 & " FROM Query1"
ssql1 = ssql1 & " GROUP BY Query1.Employee, Query1.Project"
ssql1 = ssql1 & " HAVING (((Query1.Employee)=" & Me.cbEmployeeSelect & "))"
rs.Open ssql1, CurrentProject.Connection, 1, 3
x = rs.RecordCount
If x > 13 Then x = 13
rs.MoveFirst
For i = 0 To x
If Not (rs.EOF) Then
nm = "cbProjectName" & i
Me(nm).Value = rs.Fields("Project")
Call HoursReportChk(Me.cbMonthSelect, i, Me.cbEmployeeSelect, rs.Fields("Project"))
Call txEnableSerg(i)
rs.MoveNext
End If
Next i
rs.Close
Set rs = Nothing
End Sub
When i try to run it (button click), I get the followimg error message :
"There was a problem to access a property or method of the OLE object"
Could anyone help me with this problem?
P.S - I work in multi-user invironment, with access .mdb database on the back end
I've written an application that takes care of our employees working hours.
It was developed using MSACCESS 2003 and running under both the full version of access and run time version.
Everything works fine under the full version, but there is a piece of code that causes an error under Run Time version.
Here is the code :
Private Sub btnHistory_Click()
Dim ssql1, nm As String
Dim rs As ADODB.Recordset
Dim x, i As Integer
Set rs = CreateObject("ADODB.Recordset")
ssql1 = "SELECT Count(Query1.DateOfReport) AS CountOfDateOfReport, Query1.Employee, Query1.Project"
ssql1 = ssql1 & " FROM Query1"
ssql1 = ssql1 & " GROUP BY Query1.Employee, Query1.Project"
ssql1 = ssql1 & " HAVING (((Query1.Employee)=" & Me.cbEmployeeSelect & "))"
rs.Open ssql1, CurrentProject.Connection, 1, 3
x = rs.RecordCount
If x > 13 Then x = 13
rs.MoveFirst
For i = 0 To x
If Not (rs.EOF) Then
nm = "cbProjectName" & i
Me(nm).Value = rs.Fields("Project")
Call HoursReportChk(Me.cbMonthSelect, i, Me.cbEmployeeSelect, rs.Fields("Project"))
Call txEnableSerg(i)
rs.MoveNext
End If
Next i
rs.Close
Set rs = Nothing
End Sub
When i try to run it (button click), I get the followimg error message :
"There was a problem to access a property or method of the OLE object"
Could anyone help me with this problem?
P.S - I work in multi-user invironment, with access .mdb database on the back end