V
Vern Shellman
We've got a form in Access 97 SR-2 that works fine with local tables.
The pertinent VB code populating a combo box looks like this:
Private Function ShowMOFInfo()
Dim db As Database
Dim rec As Recordset
Dim ccode As Integer
Dim strAD As String
On Error GoTo smiErrorHandler
Set db = DBEngine.Workspaces(0).Databases(0)
Set rec = db.OpenRecordset("tblMOF")
rec.Index = "PrimaryKey"
rec.Seek "=", Me!cboStudyNumber
If rec.NoMatch Then ....
When the same table is linked to an external database the form fails.
I'm not much of a VB progammer but I've learned that the problem is with
the .Seek function on linked tables. So I've tried using FindFirst in
the following manner:
On Error GoTo smiErrorHandler
Set db = DBEngine.Workspaces(0).Databases(0)
Set rec = db.OpenRecordset("tblMOF")
rec.FindFirst "StudyNumber = '" & Me![StudyNumber]& "'"
If rec.NoMatch Then ....
Looking in the Immediate Window, Rec.Fields.Count finds the correct
number of fields but I'm seeing a lot of errors declaring:
<Operation is not supported for this type of object>.
Also, error trapping gives:
"run-time error '13'; type mismatch".
However, creating a new form that pulls data from the same remote table
works, so I don't think it's a datatype issue.
What am I doing wrong?
Thanks in advance for any suggestions on how we might solve this
problem.
The pertinent VB code populating a combo box looks like this:
Private Function ShowMOFInfo()
Dim db As Database
Dim rec As Recordset
Dim ccode As Integer
Dim strAD As String
On Error GoTo smiErrorHandler
Set db = DBEngine.Workspaces(0).Databases(0)
Set rec = db.OpenRecordset("tblMOF")
rec.Index = "PrimaryKey"
rec.Seek "=", Me!cboStudyNumber
If rec.NoMatch Then ....
When the same table is linked to an external database the form fails.
I'm not much of a VB progammer but I've learned that the problem is with
the .Seek function on linked tables. So I've tried using FindFirst in
the following manner:
On Error GoTo smiErrorHandler
Set db = DBEngine.Workspaces(0).Databases(0)
Set rec = db.OpenRecordset("tblMOF")
rec.FindFirst "StudyNumber = '" & Me![StudyNumber]& "'"
If rec.NoMatch Then ....
Looking in the Immediate Window, Rec.Fields.Count finds the correct
number of fields but I'm seeing a lot of errors declaring:
<Operation is not supported for this type of object>.
Also, error trapping gives:
"run-time error '13'; type mismatch".
However, creating a new form that pulls data from the same remote table
works, so I don't think it's a datatype issue.
What am I doing wrong?
Thanks in advance for any suggestions on how we might solve this
problem.