Next Problem - Validation of product type
Posted on 2011-09-16
On to the next issue. As you can see by the code below I am trying to validate each detail to ensure the proper product is being billed out.
- The first statement checks to ensure the TagID number is for a certain shipper. This works
- Second statement ensures TagID is available for shipment, not already shipped. This works
- Third and on does not work- I am wanting to make sure for example; The TagID is the right Shape per the Load Line. If not then message to user, if correct then next check. It always tells me the Shape is not right regardless if it is or not. I have specifically changed the shape in the table and still tells me its not right. What is the best way to achieve this?
strSQL = "select * from DBO_TBL_INV_DETAILS where [INV_TAGID] = '" & TagID & "' and [INV_INB_SHIPID] = " & vIsID
Set rs = CurrentDb.OpenRecordset(strSQL, dbOpenSnapshot)
If rs.RecordCount = 0 Then
MsgBox "No Tag Available for Inbound Shipper ID - " & vIsIDName, vbOKOnly, "PULSE ERROR"
ElseIf rs.Fields("INV_AVAIL") = "N" Then
MsgBox "Tag ID " & UCase(TagID) & " Is Not Available For Shipment", vbOKOnly, "PULSE ERROR"
ElseIf Me.LD_DET_SHAPE <> rs.Fields("INV_SHAPE") Then
MsgBox "Shape Does not match load line", vbOKOnly, "PULSE ERROR"
ElseIf Me.LD_DET_SIZE <> rs.Fields("INV_SIZE") Then
MsgBox "Size Does not match load line size", vbOKOnly, "PULSE ERROR"
ElseIf Me.LD_DET_GRADE <> rs.Fields("INV_GRADE") Then
MsgBox "Grade does not match load line grade", vbOKOnly, "PULSE ERROR"
Set rs = Nothing