Drop Down Afterupdate Event? Follow

0
Avatar
Legacy Poster

Hello all, i'm a noobie to Bartender Labels, and i'm trying to figure out if there's a way to have a drop down list populate the remaining fields on a prompt dialog.. sort of an AfterUpdate event in VB.

We have a job # list (in the dropdown) and we're trying to print box labels for the job.. pulling the part #, revision level, quantity, etc. from another SQL table based on the job # selected.

Here's the kicker.. the user will also need to manually enter a few other values and also have the ability to change the quantity prior to printing the label.

Any help is appreciated!

Thanks,

Tony

1 comments

0
Avatar
Shotaro Ito
Moderator

Hi Jujijime,

There's no good method I can tell within BarTender's user prompt. If BarTender's query prompt have drop-down list, that would be a perfect solution.
Usual solution is give Query Prompt value from another application, which has dropdown list.

Use query prompt to select a record by job# list.
To create query prompt,[url="http://www.seagullscientific.com/aspx/training-video-(reading-data-from-database).aspx"]set up database connection[/url] then
in Database Connection setup > Query tab,
create query condition like
[sql]
Fields | Operator | Criteria
job# | = | New prompt...
[/sql]
in Query Prompts dialog shown, you can name the query prompt and set user prompt, default reply etc.

Once you set query prompt, it asks you job# (before user prompt) to filter record at print. (No drop-down list in query prompt. only text box.)

In user prompt, show selected record's field value on the prompt(editable or read only).
Additionally you can enable user prompt in each record for some user-defined values.
You can bring print quantity in from Prompt design view > Sub-string Toolbox at bottom right > Identical copy of label.

If you need to add a drop-down box, you can specify query prompt value from other application (BarTender Automation Edition or above needed.)
When you have query prompt of "QueryPrompt1" and want to set value "0007" from other application such as VB or Access.

In command line, you can set by "/?<Query prompt name>=<Value>" option
ex.
[code]"C:\Program Files\Seagull\BarTender Suite\bartend.exe" /F="C:\format.btw" /P /?"QueryPrompt1"="0007"[/code]

In ActiveX, you can do that by Value of QueryPrompt object.
ex.
[code]btFormat.Databases.QueryPrompts.GetQueryPrompt("QueryPrompt1").Value = "0007"[/code]

For detail, please check BarTender online help's "Automating BarTender" part.

Another thought is populate user prompt's drop-down list's options from database by VB script, then get record value in OnPostPrompt VBscript event.
This is a bit complex method - some posts like [url="http://seagullscientific.invisionzone.com/index.php?/topic/201-vbscript-to-populate-a-dropdown-list/"]this[/url] or [url="http://seagullscientific.invisionzone.com/index.php?/topic/218-some-small-questions"]this[/url] might help.

Hope it helps!

Please sign in to leave a comment.