S
Sean
hello,
I have recently split a database to allow me to easily maintain and develop
it. however, when I open a form that populates a list box from a coded query
I get the error.
"Run-time error 3251
Operation is not supported for this type of object."
I have included the code below. It falls over at every mention of "rst.="
and "rst2=". Any ideas? (it works fine in the un-split database) I have not
included all the code just up to where it falls over. I think that once I can
get over this problem the rest will work fine.
Many thanks in advance
Sean
Private Sub Form_Load()
Me.Text6 = Date - 14
Me.Text8 = Date + 14
Dim dbs As Database, tdf, tdf2 As TableDef, rst As Recordset, rst2 As
Recordset
' Return reference to current database.
Set dbs = CurrentDb
' Return reference to table.
Set tdf = dbs.TableDefs!problem_status 'solutions table, used for the
problem types
Set tdf2 = dbs.TableDefs!problem_status_MI ' the one where the call
numbers are recorded
' Open table-type Recordset object.
Set rst = dbs.OpenRecordset("problem_status")
Set rst2 = dbs.OpenRecordset("problem_status_MI")
' Set current index to new index.
rst.Index = "status_counter"
rst2.Index = "problem_status"
' create a record in the call_main_MI* tables to give a current record
starting point
rst2.AddNew
rst2.Update
' Specify record to find.
rst.Seek "=", "1"
rst2.Seek "=", Null
If rst.NoMatch Or rst2.NoMatch Then
Debug.Print "Seek failed."
Else
' populate the recordcounts for the original tables
rst.MoveLast
rst.MoveFirst
I have recently split a database to allow me to easily maintain and develop
it. however, when I open a form that populates a list box from a coded query
I get the error.
"Run-time error 3251
Operation is not supported for this type of object."
I have included the code below. It falls over at every mention of "rst.="
and "rst2=". Any ideas? (it works fine in the un-split database) I have not
included all the code just up to where it falls over. I think that once I can
get over this problem the rest will work fine.
Many thanks in advance
Sean
Private Sub Form_Load()
Me.Text6 = Date - 14
Me.Text8 = Date + 14
Dim dbs As Database, tdf, tdf2 As TableDef, rst As Recordset, rst2 As
Recordset
' Return reference to current database.
Set dbs = CurrentDb
' Return reference to table.
Set tdf = dbs.TableDefs!problem_status 'solutions table, used for the
problem types
Set tdf2 = dbs.TableDefs!problem_status_MI ' the one where the call
numbers are recorded
' Open table-type Recordset object.
Set rst = dbs.OpenRecordset("problem_status")
Set rst2 = dbs.OpenRecordset("problem_status_MI")
' Set current index to new index.
rst.Index = "status_counter"
rst2.Index = "problem_status"
' create a record in the call_main_MI* tables to give a current record
starting point
rst2.AddNew
rst2.Update
' Specify record to find.
rst.Seek "=", "1"
rst2.Seek "=", Null
If rst.NoMatch Or rst2.NoMatch Then
Debug.Print "Seek failed."
Else
' populate the recordcounts for the original tables
rst.MoveLast
rst.MoveFirst