H
hlamo
I have an Access 2003 FE & BE database running on a PC. The source for a
Combo box is a simple query that selects all 6 fields from a Sales Source
linked table. I have an After Update Event which checks the OldValue from the
Combo Box to see if it is a particular type of sales source, as it uses the
information to update counters.
When a user selects a different value in the Combo Box and so triggers off
the After Update event, I get the 3112 error on the OpenRecordset statement.
Can anyone offer advice, please? Is there a conflict between the query and
the statement?
Coding in the after-update event calls a function that contains the
following:
Function GetSalesSource(SalesSourceId As Long) As String
Dim db2 As DAO.Database
Dim rst2 As DAO.Recordset
Dim pathname2 As String
Dim dblocation2 As String
pathname2 = Application.CurrentProject.Path
dblocation2 = pathname2 & "\Tables\system tables.mdb"
GetSalesSource = "N"
Set db2 = OpenDatabase(dblocation2)
Set rst2 = db2.OpenRecordset("Sales Source")
rst2.Index = "SSrc_Id"
rst2.Seek "=", SalesSourceId
If rst2!SSrc_Description = "Repair Only" Then
GetSalesSource = "Y"
End If
rst2.Close
db2.Close
End Function
Combo box is a simple query that selects all 6 fields from a Sales Source
linked table. I have an After Update Event which checks the OldValue from the
Combo Box to see if it is a particular type of sales source, as it uses the
information to update counters.
When a user selects a different value in the Combo Box and so triggers off
the After Update event, I get the 3112 error on the OpenRecordset statement.
Can anyone offer advice, please? Is there a conflict between the query and
the statement?
Coding in the after-update event calls a function that contains the
following:
Function GetSalesSource(SalesSourceId As Long) As String
Dim db2 As DAO.Database
Dim rst2 As DAO.Recordset
Dim pathname2 As String
Dim dblocation2 As String
pathname2 = Application.CurrentProject.Path
dblocation2 = pathname2 & "\Tables\system tables.mdb"
GetSalesSource = "N"
Set db2 = OpenDatabase(dblocation2)
Set rst2 = db2.OpenRecordset("Sales Source")
rst2.Index = "SSrc_Id"
rst2.Seek "=", SalesSourceId
If rst2!SSrc_Description = "Repair Only" Then
GetSalesSource = "Y"
End If
rst2.Close
db2.Close
End Function