Author Topic: multiple outputs on one button  (Read 6636 times)

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: multiple outputs on one button
« Reply #30 on: March 09, 2017, 02:35:52 PM »
Are you using a ComboBox to select the recipe?

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: multiple outputs on one button
« Reply #31 on: March 09, 2017, 08:48:56 PM »
Yes, on the recipe screen I am using the ComboBox with a Load This Recipe button.

What  I want to do is display the recipe name only on MainForm without the operator being able to select another recipe (the recipe FormChangeButton is hidden when in cycle to prevent It being changed)

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: multiple outputs on one button
« Reply #32 on: March 09, 2017, 09:08:40 PM »
From the DataSource, change the recipe name column to a ComboBox by clicking the icon to the right of the name. Then drag that onto the form. It will do everything for you to populate the ComboBox.

When you created your database table, did you create an ID column?

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: multiple outputs on one button
« Reply #33 on: March 10, 2017, 06:47:18 PM »
I renamed the ID to Number, and it is still the key item.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: multiple outputs on one button
« Reply #34 on: March 11, 2017, 08:16:48 PM »
I renamed the ID to Number, and it is still the key item.
I figured it would be easier to give an example instead of trying to explain all of the intricacies, so I upload a RecipeDBSample :

https://sourceforge.net/projects/advancedhmi/files/advancedhmi/3.5/SampleProjects

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: multiple outputs on one button
« Reply #35 on: March 11, 2017, 09:54:54 PM »
Archie,

That's a nice example, but I already have a recipe entry that works.

What I am looking for is to pull the field "Name" based on the recipe number selected that is in integer N10:0 to display the name on a screen where the operator can not change the recipe.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: multiple outputs on one button
« Reply #36 on: March 11, 2017, 10:21:52 PM »
Add a DataSubscriber to look at N10:0

In the DataChanged event something like this:

        Label1.Text = RecipeDataSet.RecipeMaster.FindByRecipeId(e.Values(0)).Name

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: multiple outputs on one button
« Reply #37 on: March 12, 2017, 07:49:57 AM »
Archie,

Thanks - that works great