R
Ron B.
I've recently converted an Access97 file to Access2003. During the
conversion, there were "compilation errors" due to old DAO syntax no
longer supported.
I hired an Access programer to fiddle with the code and he got it
working. Been using the program for over a month.... when we just
started getting the following error:
"Compile Error: Function or Interface Marked as Restricted..."
On the following code:
#################
Dim mydb As Database, MyQuery As QueryDef
If IsNull(GreigePattern) Then
Exit Sub
End If
Set mydb = CurrentDb()
'Set MyQuery = mydb.CreateQueryDef("Change Dept") ' Create query.
If IsNull(mydb.QueryDefs("Change Dept")) Then
Set MyQuery = mydb.CreateQueryDef("Change Dept") ' Create query.
Else
Set MyQuery = mydb.QueryDefs("Change Dept")
End If
' Set SQL property.
MyQuery.SQL = "UPDATE DISTINCTROW GreigePattern SET
GreigePattern!Department = [prmDepartment] WHERE
GreigePattern!GreigeNumber = [prmGreige] AND GreigePattern!KnitterCode =
[prmKnitter];"
MyQuery.Parameters("prmDepartment") =
[Forms]![frmColorRequests]![cboDepartment]
MyQuery.Parameters("prmGreige") = [Forms]![frmColorRequests]![GreigeNumber]
MyQuery.Parameters("prmKnitter") = [Forms]![frmColorRequests]![cboKnitter]
MyQuery.Execute ' Invoke query.
MyQuery.Close ' Close query.
mydb.DeleteQueryDef ("Change Dept") ' Delete query.
#############
The error is with the very lastline: "DeleteQueryDef"
This type of code, with the DeleteQueryDef is used in about 5 other
places in the program. they all error.
Any Ideas??? Especially, since it has been working just fine, till a
day or two ago... no updates of any kind have been made either...
that I know of.
Thanks!
Ron
conversion, there were "compilation errors" due to old DAO syntax no
longer supported.
I hired an Access programer to fiddle with the code and he got it
working. Been using the program for over a month.... when we just
started getting the following error:
"Compile Error: Function or Interface Marked as Restricted..."
On the following code:
#################
Dim mydb As Database, MyQuery As QueryDef
If IsNull(GreigePattern) Then
Exit Sub
End If
Set mydb = CurrentDb()
'Set MyQuery = mydb.CreateQueryDef("Change Dept") ' Create query.
If IsNull(mydb.QueryDefs("Change Dept")) Then
Set MyQuery = mydb.CreateQueryDef("Change Dept") ' Create query.
Else
Set MyQuery = mydb.QueryDefs("Change Dept")
End If
' Set SQL property.
MyQuery.SQL = "UPDATE DISTINCTROW GreigePattern SET
GreigePattern!Department = [prmDepartment] WHERE
GreigePattern!GreigeNumber = [prmGreige] AND GreigePattern!KnitterCode =
[prmKnitter];"
MyQuery.Parameters("prmDepartment") =
[Forms]![frmColorRequests]![cboDepartment]
MyQuery.Parameters("prmGreige") = [Forms]![frmColorRequests]![GreigeNumber]
MyQuery.Parameters("prmKnitter") = [Forms]![frmColorRequests]![cboKnitter]
MyQuery.Execute ' Invoke query.
MyQuery.Close ' Close query.
mydb.DeleteQueryDef ("Change Dept") ' Delete query.
#############
The error is with the very lastline: "DeleteQueryDef"
This type of code, with the DeleteQueryDef is used in about 5 other
places in the program. they all error.
Any Ideas??? Especially, since it has been working just fine, till a
day or two ago... no updates of any kind have been made either...
that I know of.
Thanks!
Ron