A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

DAO Recordset FindFirst HELP



 
 
Thread Tools Display Modes
  #1  
Old May 11th, 2006, 04:48 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default DAO Recordset FindFirst HELP

Im getting this very annoying error and cant figure it out for the life
of me. basically on the masternum.findfirst(criteria) line, it throws
an error that states... "Run-time error '3436' data type mismatch in
criteria expression" ive checked all my tables to make sure the data
types are correct and nothing is different. if ANYONE can help, it
would be great. thankyou.

Do Until upcnum.EOF
upc = upcnum!UPCCase
criteria = "[CustNbr] = '" & num & "' AND [UPCCase] = '" &
upc & "'"
masternum.FindFirst (criteria)
If masternum.NoMatch() Then
final.AddNew
final!num = num
final!case = UPCCase
final.Update
End If
upcnum.MoveNext
Loop

  #2  
Old May 11th, 2006, 04:55 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default DAO Recordset FindFirst HELP

If you open your table in design view, what data types are CustNbr and
UPCCase?

If number, lose the extra quotes:
criteria = "([CustNbr] = " & num & ") AND ([UPCCase] = upc & ")"

You may also be able to see what is wrong if you:
Debug.Print criteria
just before the FindFirst. When it fails, check what came out in the
Immediate Window (Ctrl+G).


--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Brandon Johnson" wrote in message
ups.com...
Im getting this very annoying error and cant figure it out for the life
of me. basically on the masternum.findfirst(criteria) line, it throws
an error that states... "Run-time error '3436' data type mismatch in
criteria expression" ive checked all my tables to make sure the data
types are correct and nothing is different. if ANYONE can help, it
would be great. thankyou.

Do Until upcnum.EOF
upc = upcnum!UPCCase
criteria = "[CustNbr] = '" & num & "' AND [UPCCase] = '" &
upc & "'"
masternum.FindFirst (criteria)
If masternum.NoMatch() Then
final.AddNew
final!num = num
final!case = UPCCase
final.Update
End If
upcnum.MoveNext
Loop



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Performance: FindFirst, FindNext vs Open New Recordset Danny J. Lesandrini General Discussion 4 December 22nd, 2005 10:41 PM
passing a recordset 85ascMcLaren Setting Up & Running Reports 1 August 6th, 2005 04:16 PM
ASP recordset as SQL table Ennex Database Design 8 March 5th, 2005 06:38 PM
Porting Access DB to ASP; use recordset as SQL table? Ennex Running & Setting Up Queries 1 March 4th, 2005 12:27 AM
How to loop through a recordset and update the field of a recordset or delete current record Karen Middleton Running & Setting Up Queries 1 January 4th, 2005 10:30 AM


All times are GMT +1. The time now is 07:40 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.