'Find' Problem (ADO)

NNLogistics

Registered User.
Local time
Today, 16:03
Joined
Mar 30, 2009
Messages
14
I hope this makes sense(It doesn't to me). If the Record exits, I update the record, If it doesn't exit then I write it (This code is not displayed). If the record has a positive Quantity I can find it, if its a zero, it gets to EOF. I have to be missing something. I dont see why Quantity has anything to do with 'Find" on the key. Is it possible I have something wrong on Connect and Open Options? I'm just reaching I guess.

tblInventory has 5 fields
fldKey(Combination Warehouse and P/N) – Text
fldWarehouse – Text
fldPartNumber – Text
fldDescription –Text
fldQuantity – Number

Me.txtToKey = (Me.cmboToWarehouse + Me.cmboPartNumber)

'Make Connection
Dim Conn As ADODB.Connection
Dim rst As ADODB.Recordset
Set Conn = New ADODB.Connection
Conn.Open CurrentProject.Connection
Set rst = New ADODB.Recordset

'Open Query

rst.Open "qryAllWarehouseInventory", Conn, adOpenDynamic, adLockOptimistic

'Find "ToKey" Record - make sure that the Part Number exits in the To Warehouse
'And use this as a switch to either write or update
rst.MoveFirst

rst.Find "fldKey = '" & Me.txtToKey & "'"
If rst.EOF Then
MsgBox ("Not Found")


When I am looking for a record(warehouse and P/N) that has a positive number in Quantity – No problem. If fldQuantity is 0, I always get to “Not Found”.

As usual thank you for your time.

Joe
 
Thanks Uncle gizmo

SELECT tblInventory.fldWarehouse, tblInventory.fldPartNumber, tblInventory.fldDescription, tblInventory.fldQuantity, tblInventory.fldKey
FROM Products INNER JOIN (qryAllActiveWarehouses INNER JOIN tblInventory ON qryAllActiveWarehouses.WarehouseID = tblInventory.fldWarehouse) ON Products.PartNumberID = tblInventory.fldPartNumber
WHERE (((tblInventory.fldQuantity)<>0))
ORDER BY tblInventory.fldKey;

I just needed to be brought back to basic's, so thank you so much
 

Users who are viewing this thread

Back
Top Bottom