[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Findfirst and edit record (string vs Single)

Posted on 2008-06-19
5
Medium Priority
?
1,320 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 46

Expert Comment

by:tbsgadi
ID: 21819901
Hi darkprowler,

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

Good Luck!

Gary
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 750 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

650 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