?
Solved

RST.Findfirst error 3251 Operation Is not supported by this type of Object error

Posted on 2012-08-25
12
Medium Priority
?
1,065 Views
Last Modified: 2012-08-26
I am having this error on the rst.findfirst method.
The recordset is defined and it os open for edit and the field Me.F0302.... contains valid ascii characters

The code ist like this:

    strSearch = "T01_UserSet!T01_NomeCompleto = " & Me.F0302_DestinatarioInterno
    T01_UserSet.FindFirst (strSearch)  <-------- th problem line
    If T01_UserSet.NoMatch Then
        IBool = InsertLog("F0302_Btn_Novo_Registo_Click", "procura nome", Me.F0302_DestinatarioInterno, "", "", 8, 4, strUserID, "Incoerência grave: Nome Completo não encontrado")
        I = MostraErro(8, "Usado email de reserva")
        strOutUserEmail = T00_ControlTableSet!T00_DefaultSendUserEmail
    Else
        strOutUserEmail = Nz([T01_UserSet]![T01_Email])
        If (strOutUserEmail = "") Then 'use the predifined email
        strOutUserEmail = T00_ControlTableSet!T00_DefaultSendUserEmail
        End If
    End If


can anyone help?


screenshot
0
Comment
Question by:João serras-pereira
  • 6
  • 6
12 Comments
 
LVL 29

Expert Comment

by:IrogSinta
ID: 38332533
If F0302_DestinatarioInterno is a String, try this:
strSearch = "T01_UserSet!T01_NomeCompleto = '" & Me.F0302_DestinatarioInterno & "'"

Open in new window

0
 

Author Comment

by:João serras-pereira
ID: 38332895
tried... did not work. It gave exactly the same error
0
 
LVL 29

Expert Comment

by:IrogSinta
ID: 38332908
What kind of recordset are you using?  Your code doesn’t show it.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:João serras-pereira
ID: 38332980
I can upload the database if you think its useful. I used an example from "MSAccess 2010 Programmers Reference" (page 191) and I did not define any special kind.

The record set is defined in the following manner:

 Dim T00_ControlTableSet As DAO.Recordset, _
         T01_UserSet As DAO.Recordset, _       <------ the record set
         T13_TramitDocSet As DAO.Recordset, _
         T14_RegistosEntradaSet As DAO.Recordset

then:

    Set cdiDB = CurrentDb
    Set LogFileSet = cdiDB.OpenRecordset("T02_LogFile", dbOpenTable)
    Set T00_ControlTableSet = cdiDB.OpenRecordset("T00_ControlTable", dbOpenTable)
    Set T01_UserSet = cdiDB.OpenRecordset("T01_User", dbOpenTable)
    Set T03_FichaDocumentoSet = cdiDB.OpenRecordset("T03_FichaDocumento", dbOpenTable)
    Set T13_TramitDocSet = cdiDB.OpenRecordset("T13_TramitDoc", dbOpenTable)
    Set T14_RegistosEntradaSet = cdiDB.OpenRecordset("T14_REgistosEntrada", dbOpenTable)
     
    T00_ControlTableSet.Edit
    T01_UserSet.Edit

and further down the code I have set you
0
 
LVL 29

Assisted Solution

by:IrogSinta
IrogSinta earned 2000 total points
ID: 38333024
Try using a dynaset type
Set T01_UserSet = cdiDB.OpenRecordset("T01_User", dbOpenDynaset)
0
 

Author Comment

by:João serras-pereira
ID: 38333098
well.. IT IMPROVING. But I am still getting an arror message: it states that the fiels dos not exist!
I am attaching the screenshots
sshot1sshot2
0
 
LVL 29

Expert Comment

by:IrogSinta
ID: 38333106
Do you actually have a field named T01_NomeCompleto in your table T01_User?  Double check the spelling if you do.
0
 

Author Comment

by:João serras-pereira
ID: 38333226
eyap. That was my first guess.. But I think I have everything ok... Please check the screenshot....
screenshot 3
0
 
LVL 29

Accepted Solution

by:
IrogSinta earned 2000 total points
ID: 38333298
Wait a minute, that should be...
strSearch = "T01_NomeCompleto = '" & Me.F0302_DestinatarioInterno & "'"

Open in new window

0
 

Author Closing Comment

by:João serras-pereira
ID: 38333699
Great! Really, thanks!

now I am going to try to learn the difference between dbOpenTable and dbOpenDynaSet...
0
 
LVL 29

Expert Comment

by:IrogSinta
ID: 38334181
Excerpt from Help file...

With dynaset- and snapshot-type Recordset objects in a Microsoft Jet workspace, you can also use the Find methods, such as FindFirst, to locate a specific record based on criteria. If the record isn't found, the NoMatch property is set to True. For table-type Recordset objects, you can scan records using the Seek method.


·      Table-type Recordset — representation in code of a base table that you can use to add, change, or delete records from a single database table (Microsoft Jet workspaces only).

·      Dynaset-type Recordset — the result of a query that can have updatable records. A dynaset-type Recordset object is a dynamic set of records that you can use to add, change, or delete records from an underlying database table or tables. A dynaset-type Recordset object can contain fields from one or more tables in a database. This type corresponds to an ODBC keyset cursor.

·      Snapshot-type Recordset — a static copy of a set of records that you can use to find data or generate reports. A snapshot-type Recordset object can contain fields from one or more tables in a database but can't be updated. This type corresponds to an ODBC static cursor.

·      Forward-only-type Recordset — identical to a snapshot except that no cursor is provided. You can only scroll forward through records. This improves performance in situations where you only need to make a single pass through a result set. This type corresponds to an ODBC forward-only cursor.

·      Dynamic-type Recordset — a query result set from one or more base tables in which you can add, change, or delete records from a row-returning query. Further, records other users add, delete, or edit in the base tables also appear in your Recordset. This type corresponds to an ODBC dynamic cursor (ODBCDirect workspaces only).
0
 

Author Comment

by:João serras-pereira
ID: 38334448
Thanks again!!!! So I'll use, in access the dynaset as it is a better option albeit a bit less universal
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question