Expand|Select|Wrap|Line Numbers
- Sub LoadPoList(FieldNo,strConnect)
- Do until frmAddInvoice("cmbConsPO" & FieldNo).length = 0
- frmAddInvoice("cmbConsPO" & FieldNo).remove 0
- loop
- Max = FieldNo + 5
- value = FieldNo
- strConn = "Driver={SQL Server}; Server=" & MyServer & ";Database=" & MyDB & "; Uid=" & MyUserName & ";"
- strConn = strConn & " Pwd=" & MyPassWord & ";"
- Set myConn = Server.CreateObject("ADODB.Connection")
- myConn.Open strConn
- UseOwner = Trim(document.frmAddInvoice.cmbOwner.value)
- UseDestination = Trim(document.frmAddInvoice.cmbDestination.value)
- UsePart = Trim(document.all("txtGTW" & FieldNo).Value)
- strSQL = "SELECT DISTINCT ReferenceID FROM InventoryTransactions WHERE (TransactionType = 'Shipment') AND (Invoice IS NULL) AND (Destination = '" & UseDestination & "') AND (COID = " & UseOwner & ") AND (PartNumber = '" & UsePart & "')"
- set rds = conn.execute(strSQL, dbOpenDynaset)
- Do While not rds.eof
- AddToDropDown(FieldNo,"")
- Do While Not rds.eof
- AddToDropDown(FieldNo,ReferenceID)
- rds.movenext
- loop
- rds.close
- set rds = nothing
- set myConn = nothing
- End Sub