473,785 Members | 2,794 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Forms using linked tables fail


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.Worksp aces(0).Databas es(0)
Set rec = db.OpenRecordse t("tblMOF")
rec.Index = "PrimaryKey "
rec.Seek "=", Me!cboStudyNumb er
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.Worksp aces(0).Databas es(0)
Set rec = db.OpenRecordse t("tblMOF")
rec.FindFirst "StudyNumbe r = '" & Me![StudyNumber]& "'"
If rec.NoMatch Then ....

Looking in the Immediate Window, Rec.Fields.Coun t 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.

Thanks in advance for any suggestions on how we might solve this
problem.

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #1
2 2530
Seek only works on local tables opened as table-type recordset. Linked
tables can't be opened as table-type recordsets; to be writeable, must be
opened as dynasets, for which Seek is not supported. Try "FindFirst" ,
instead.

Larry Linson
Microsoft Access MVP

"Vern Shellman" <ve***********@ uchsc.edu> wrote in message
news:40******** **************@ news.newsgroups .ws...

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.Worksp aces(0).Databas es(0)
Set rec = db.OpenRecordse t("tblMOF")
rec.Index = "PrimaryKey "
rec.Seek "=", Me!cboStudyNumb er
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.Worksp aces(0).Databas es(0)
Set rec = db.OpenRecordse t("tblMOF")
rec.FindFirst "StudyNumbe r = '" & Me![StudyNumber]& "'"
If rec.NoMatch Then ....

Looking in the Immediate Window, Rec.Fields.Coun t 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.

Thanks in advance for any suggestions on how we might solve this
problem.

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 13 '05 #2
Vern Shellman <ve***********@ uchsc.edu> wrote in message news:<40******* *************** @news.newsgroup s.ws>...
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:
...
On Error GoTo smiErrorHandler
Set db = DBEngine.Worksp aces(0).Databas es(0)
Set rec = db.OpenRecordse t("tblMOF")
rec.FindFirst "StudyNumbe r = '" & Me![StudyNumber]& "'"
If rec.NoMatch Then ....


See if
rec.FindFirst "StudyNumbe r = " & Me![StudyNumber]
instead of
rec.FindFirst "StudyNumbe r = '" & Me![StudyNumber]& "'"
works.
Looking up an Integer or Long using a string would cause a type mismatch.

James A. Fortune
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
16882
by: polytimi8 | last post by:
Hello, I would like to know if it is possible to create a form in Access2000, which would function like a calendar for 8 operating rooms in hospital, showing which hours are those closed for a specific date. For this intersection I would like to be appeared the name of the doctor, the name of the patient and the kind of operation. Furthemore I would like this intersection to be marked in the calendar with a colour, showing that this...
3
4418
by: Jonathan Bishop | last post by:
Hi. We are using MSDE2000 on a Point of Sale application. We need to keep a copy of a few key tables as up to date as possible for backup purposes. We are looking at using triggers over the source tables to update the target tables using a linked servers setup. Distributed Transaction Coordinator is running on both source and target servers. This following create command:
1
1473
by: Hank Reed | last post by:
Microsoft Access help says the maximum number of Modules, Forms, and Reports is 1000. It appears that linked tables do not count. What about local tables? Help also says that the maximum number of open tables is 2048 (or less). That would seem to leave linked tables out of the above mix. Can anyone comment on these limits or quote personal experience?
2
1790
by: DataB | last post by:
Hi everyone! I have a forms problem. Bakground: I have created a number of tables. Of these, I have a main parent table (Personal Details) and a number of other child tables (Tax file No., VISA card no.), etc...... All tables have a primary key of "Name", all child tables forming
2
1520
by: Mark | last post by:
I have been developing a new application (FE on local drive) which is attached to tables in a BE on a server. For testing purposes I had a copy of the BE in the same folder as the live BE and the application and forms loaded quickly. The application is now ready to go live and using the linked table manager I have tried relinking the tables to the live BE. The tables (around 50) relink but it takes a while through the linked table...
4
1651
by: danthrom | last post by:
Hi, I have a database with four tables. tbl_Client client_alias (PK, text) tbl_Matters matterID (PK, autonumber) matter (text) client_alias (foreign key, tbl_Client)
4
3484
by: robertmeyer1 | last post by:
Hey, I have about 5 tables, and each table has a corresponding form. The 1st table (A) is a client data table (client information) with a ClientID (PK). This clientId is a (FK) in all 4 other tables (B-E). Now I have the tables linked in a relationship by PK-FK (1-to-1 relationships). The forms are set to go form A to form E by use of command buttons (click on in form A and opens form B...). The issue is, when I enter data in form A then...
1
1756
by: kkrizl | last post by:
I've tried to research this problem, and I haven't been able to find any references to it. Probably because I shouldn't be doing it, but it was working, and now it's not. I'm trying to develop a small application to run on our intranet. I have a lot of old knowledge, and not a lot off access to new knowledge, so I'm shooting from the hip and fumbling. I have a small Access database that I'm using as a back end for some ..ASP pages. ...
2
4941
by: Luting | last post by:
Hi, Is it possible to update oracle via Access forms? I am thinking maybe I could make a link table connnected with oracle database. And the form could be based on the link table. Does this sound feasible? Any better ways? Thank you.
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8974
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2880
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.