• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1324
  • Last Modified:

Findfirst and edit record (string vs Single)

Hello
  I am Trying to use findfirst to edit a record where the fields  are text , can't seam to get it to work ,
  but if i change the fields to numbers it works perfect  
  have no idea what i am doing wrong
 
Dim db As DAO.Database
          Dim rs As DAO.Recordset
          Set db = CurrentDb
               Set rs = db.OpenRecordset("parts", dbOpenDynaset)
               With rs
                    .FindFirst "[text]=" & Form.text1
                  If Not .NoMatch Then
                        .Edit
                        .Update
                       End If
                   Else
                     MsgBox "record not found"
                  End If
                End With
       Set rs = Nothing

Open in new window

0
darkprowler
Asked:
darkprowler
  • 2
  • 2
1 Solution
 
tbsgadiCommented:
Hi darkprowler,

try  .FindFirst "[text]='" & Form.text1 & "'"

Good Luck!

Gary
0
 
Rey Obrero (Capricorn1)Commented:


                   .FindFirst "[text]='" & Me.text1 &"'"
0
 
darkprowlerAuthor Commented:
hi Guys
sorry but that don't work i get an  error  3077  syntax error (missing operator) in both you cases
it is strange if i use it where the data type of the fields is set to number it works  but not when they are set to text
 
0
 
tbsgadiCommented:
.FindFirst "[text]='" & Forms.Formname.text1 & "'"
Substitute Formname with the name of the form.
Do you have a field in the table called Text?
If so maybe change the name of the field.
If not replace text with the name of the field
0
 
Rey Obrero (Capricorn1)Commented:
do a compact and repair

do a Debug>compile
clear errors

open your references see if you have MISSSING
if not unchecked one of the reference click OK
open the references and check the one that you unchecked ( refresh the references)
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now