Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Access FindFirst Syntax Error


Message #1 by "Craig Thompson" <Dionysius@b...> on Tue, 24 Sep 2002 14:36:58
Private Sub ShowRecord_Click()
Dim rst As Recordset
Set rst = Forms!Current_Diabetic_Register.RecordsetClone
rst.FindFirst "AutoNumber = " & List0
Forms!Current_Diabetic_Register.Bookmark = rst.Bookmark
DoCmd.Close acForm, "GoToRecordDialog"
End Sub

I am using the above code to move to a record in a form using a listbox.
 When I run the code I get a syntax error 3077. There is obviously 
something wrong with "AutoNumber = " & List0 can anyone help. The field 
AutoNumber is as it suggests an AutoNumber.


Many thanks


Craig
Message #2 by joe.dunn@c... on Tue, 24 Sep 2002 15:12:09 +0000
The format for the criteria to be used in a FIND command when the field
 is
a numeric field is on the lines of:


"[MyField] =3D " & [Control]



If the field is alphabetic, the format would be:



=3D "[MyField] =3D ' "& [Control] & "' "



So first  check that the field being searched for (Autonumber) and the
field used to match (List0) are both numbers. You may be using a text f
ield
to find a numeric field.



I always enclose the field names in square brackets ([ and ]) ....as a
habit to safeguard against embedded blanks - e.g. [Last Date]....but I 
am
not sure whether this is anything to do with your problem.



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

This e-mail may contain confidential information or be privileged. It is intended to be read and used only by the named
recipient(s). If you are not the intended recipient(s) please notify us immediately so that we can make arrangements for its return:
you should not disclose the contents of this e-mail to any other person, or take any copies. Unless stated otherwise by an
authorised individual, nothing contained in this e-mail is intended to create binding legal obligations between us and opinions
expressed are those of the individual author.

The CIS marketing group, which is regulated for Investment Business by the Financial Services Authority, includes:
Co-operative Insurance Society Limited Registered in England number 3615R - for life assurance and pensions
CIS Unit Managers Limited Registered in England and Wales number 2369965  - for unit trusts and PEPs
CIS Policyholder Services Limited Registered in England and Wales number 3390839 - for ISAs and investment products bearing the CIS
name
Registered offices: Miller Street, Manchester M60 0AL   Telephone  0161-832-8686   Internet  http://www.cis.co.uk   E-mail
cis@c...

CIS Deposit and Instant Access Savings Accounts are held with The Co-operative Bank p.l.c., registered in England and Wales number
990937, P.O. Box 101, 1 Balloon Street, Manchester M60 4EP, and administered by CIS Policyholder Services Limited as agent of the
Bank.

CIS is a member of the General Insurance Standards Council

CIS & the CIS logo (R) Co-operative Insurance Society Limited

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

  Return to Index