VBScript - Getting Field Values to Pass to SQL Query for Validation フォローする
I have added VB Script to connect to an SQL table and get the last serial number printed and I need to send the user BarTender form entered value of a different field along with the query in order to get the range to check for duplicates. Reason: This is required as we have roughly 10 different parts and templates that print serial numbers that all must be unique across all parts, not just unique per part.
I have no issues with the VB & SQL, but I’m having trouble working out how I go about accessing the value that the user enters into the printing form.
Example of what I’m attempting to do:
range_field_value = Fields(‘range_field’) ‘ Doesn’t work, just returns 123456789
range_field_value = Format.Objects("quantity_range").Value ‘ Error on operation for this object type
I have an SQL query that will send the range_field_value to a stored procedure and I'll use it to validate. The SQL has been tested and is working, I just need to get the field value.
I’ve reviewed and attempted to use the article entitled “Vb Script Accessing Entered Form Field Value (https://support.seagullscientific.com/hc/en-us/articles/360013127973?input_string=vb+script+-+accessing+entered+form+field+value)”, but I simply get the same “123456789” value.
Is there a specific example or tutorial that you could point me to on how to get the value of a field within VB Script?
Any help would be very much appreciated. Thanks for reading!