Solved

Findfirst and edit record (string vs Single)

Posted on 2008-06-19
5
1,274 Views
Last Modified: 2013-11-27
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
Comment
Question by:darkprowler
  • 2
  • 2
5 Comments
 
LVL 46

Expert Comment

by:tbsgadi
ID: 21819901
Hi darkprowler,

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

Good Luck!

Gary
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 21821200


                   .FindFirst "[text]='" & Me.text1 &"'"
0
 

Author Comment

by:darkprowler
ID: 21828909
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
 
LVL 46

Expert Comment

by:tbsgadi
ID: 21829264
.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
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 250 total points
ID: 21830677
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

910 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now