NNLogistics
Registered User.
- Local time
- Today, 11:53
- 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
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