Problem2 after upsizing

M

MarcVS

I've done the upsizing of my Access database with the SSMA wizard of Access.
(Linked tables, not ADP)

Now I've got the following problem:

In my Code I have:

*****************************
Set DB = DBEngine.Workspaces(0).Databases(0) .
Set Kontrakt = DB.OpenRecordset("Kontrakten", DB_OPEN_DYNASET, dbSeeChanges)

Kontrakt.Index = "KlantId"
Kontrakt.Seek "=", Forms![Klanten]![KlantID]

KlantNrIn = Forms![Klanten]![KlantID]

*****************************

I get an error on the line 'Kontrakt.Index = "KlantId"' : 'Operation is not
supported on this type of object'

What could be the problem?

Marc
 
B

Baz

MarcVS said:
I've done the upsizing of my Access database with the SSMA wizard of Access.
(Linked tables, not ADP)

Now I've got the following problem:

In my Code I have:

*****************************
Set DB = DBEngine.Workspaces(0).Databases(0) .
Set Kontrakt = DB.OpenRecordset("Kontrakten", DB_OPEN_DYNASET, dbSeeChanges)

Kontrakt.Index = "KlantId"
Kontrakt.Seek "=", Forms![Klanten]![KlantID]

KlantNrIn = Forms![Klanten]![KlantID]

*****************************

I get an error on the line 'Kontrakt.Index = "KlantId"' : 'Operation is not
supported on this type of object'

What could be the problem?

Marc

The DAO Index property and Seek method are only supported for table-type
recordsets, and you can't create a table-type recordset from linked tables.
You'll have to rewrite the code to use one of the DAO find methods e.g.
FindFirst.
 
M

MarcVS

I've changed the code to

strSearch = "KlantID = '" & Forms![Klanten]![KlantID] & "'"
Kontrakt.MoveLast
Kontrakt.FindFirst strSearch

This gives me a NoMatch, but the record is there...

It also seems to give the error: Cannot find the field 'KlantID' but in the
Direct Window the code '? Kontrakt.Fields("KlantID")' works???

Marc

Baz said:
MarcVS said:
I've done the upsizing of my Access database with the SSMA wizard of Access.
(Linked tables, not ADP)

Now I've got the following problem:

In my Code I have:

*****************************
Set DB = DBEngine.Workspaces(0).Databases(0) .
Set Kontrakt = DB.OpenRecordset("Kontrakten", DB_OPEN_DYNASET, dbSeeChanges)

Kontrakt.Index = "KlantId"
Kontrakt.Seek "=", Forms![Klanten]![KlantID]

KlantNrIn = Forms![Klanten]![KlantID]

*****************************

I get an error on the line 'Kontrakt.Index = "KlantId"' : 'Operation is not
supported on this type of object'

What could be the problem?

Marc

The DAO Index property and Seek method are only supported for table-type
recordsets, and you can't create a table-type recordset from linked
tables.
You'll have to rewrite the code to use one of the DAO find methods e.g.
FindFirst.
 
R

RoyVidar

MarcVS said:
I've changed the code to

strSearch = "KlantID = '" & Forms![Klanten]![KlantID] & "'"
Kontrakt.MoveLast
Kontrakt.FindFirst strSearch

This gives me a NoMatch, but the record is there...

It also seems to give the error: Cannot find the field 'KlantID' but
in the Direct Window the code '? Kontrakt.Fields("KlantID")'
works???

Marc

Baz said:
message
I've done the upsizing of my Access database with the SSMA wizard
of Access.
(Linked tables, not ADP)

Now I've got the following problem:

In my Code I have:

*****************************
Set DB = DBEngine.Workspaces(0).Databases(0) .
Set Kontrakt = DB.OpenRecordset("Kontrakten", DB_OPEN_DYNASET, dbSeeChanges)

Kontrakt.Index = "KlantId"
Kontrakt.Seek "=", Forms![Klanten]![KlantID]

KlantNrIn = Forms![Klanten]![KlantID]

*****************************

I get an error on the line 'Kontrakt.Index = "KlantId"' :
'Operation is not
supported on this type of object'

What could be the problem?

Marc

The DAO Index property and Seek method are only supported for
table-type
recordsets, and you can't create a table-type recordset from linked
tables.
You'll have to rewrite the code to use one of the DAO find methods
e.g.
FindFirst.


I think the message might refer to the form control - are you sure you
have a form control named KlantID on the form Klanten?

Else, if the field is numeric, you wouldn't need the single quotes, and
I think the .findfirst method starts at the beginning of the recordset
regardless of cursor position, so I think the .movelast doesn't do
anything worthwhile.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top