stricknine
Programmer
We have just recently purchased GP v 7.5 and no one in my department is familiar with the product. I have written VBA in the past and am pretty good at it. Now my question should be simple. On Card Inventory then on the item selection. The Item number field. We have built an auto-incrementing Identification number routine. The problem lies in that the only way that we can get that value into that field is by pulling it from the database via a recordset. If we try to put a literal or even variable string into the text field we seen nothing if it is coming from the record set then it's cool.
CODE:
cmd.CommandText = "SELECT MAX(ITEMNMBR)+1 FROM IV00101 WHERE ITEMNMBR < '99999999'"
Set rst = cmd.Execute
cmd.CommandText = "INSERT INTO IV00101 (ITEMNMBR, DECPLQTY, DECPLCUR) VALUES('" + CStr(rst(0)) + "', 1, 3)"
cmd.Execute
'set value in form...
'----------------------------------------
ItemNumber.Value = CStr(rst(0))
'ItemNumber.Value = "LiteralDoesNotWork"
'----------------------------------------
cn.Close
End Sub
Please let me know what I am doing wrong,
stricknine
CODE:
cmd.CommandText = "SELECT MAX(ITEMNMBR)+1 FROM IV00101 WHERE ITEMNMBR < '99999999'"
Set rst = cmd.Execute
cmd.CommandText = "INSERT INTO IV00101 (ITEMNMBR, DECPLQTY, DECPLCUR) VALUES('" + CStr(rst(0)) + "', 1, 3)"
cmd.Execute
'set value in form...
'----------------------------------------
ItemNumber.Value = CStr(rst(0))
'ItemNumber.Value = "LiteralDoesNotWork"
'----------------------------------------
cn.Close
End Sub
Please let me know what I am doing wrong,
stricknine