Hi All,
I created a access database to scan tools in and out of our tool room to be reworked. I have a scan in form which works fine, and I have a scan out form which works also. The problem I have is I have Message Box pop up that asks if any tools are missing from the box that they come in(i.e. scrap or broken) And that part of the database also works. Problem is I want to verify that the user is not entering more missing tools than there are in a box. Example would be that a particular box that was scanned holds 12 tools, and the user scans it and the database asks if there are any missing and the user enters 30. That would skew my data, so I want to put a check in place to look at that particular tool number to see what the default number of tools that are supposed to be in the box and deduct the missing from that number. So I have the following code:
Code:
str_SQL2 = "SELECT CGBoxStatusIn.CGBox, ToolDetail.ToolsperBox " & _
"FROM ToolDetail INNER JOIN CGBoxStatusIn " & _
"ON [ToolDetail].CGBox = [CGBoxStatusIn].CGBox " & _
"WHERE (((CGBoxStatusIn.CGBox) ='" & str_CGBox & "'));"
Set toolsperbox = db.OpenRecordset(str_SQL2, dbOpenDynamic, dbSeeChanges)
And that's where I'm stuck. How to I look at the result of the above query so that I can place it into a variable and subtract the amount missing from that?
The "str_CGBox" is the input field from the scanned box and when I run this query in access it tells me how many tools are in the box.
Where do I go from here?
Thanks in advance,
Lenny