Groups > Superbase > Superbase 3 programming > Re: ComboBox




ComboBox

ComboBox
Thu, 19 Jul 2007 14:09:21 -040
Hi.
I am a new programmer in SuperBase, version 3.6.

I am making modification to a form from an existing Superbase application.

I need to add a ComboBox to let the user make a selection from the field
("code") of the Lookup table, that is not linked to the Main table,
which is
the data source of the form. On this form there is a TextBox with Control
Source which is a field of the Main table. This field contains the same
information that is in the field ("code") of the Lookup table.

What should be done so that when a user makes a selection in a ComBobox, it
will change the data in a TextBox to update the record in the table?

I appreciate in advance.

Lily

Post Reply
Re: ComboBox
Thu, 19 Jul 2007 21:04:59 -040
Hello Lily,
I will assume you are using superbase.process().  This approach will
not work if you are using EDIT... END EDIT.

1. Use the Edit Properties Dialog to assign an event procedure to the
onselchange property of the combo box.  Lets call it "SelChanged".

2. Create that procedure and add the following in it:
Sub SelChanged
   dim i%
   i% = me.GetSelected()
   if i% > 0 then 
      me.parent.formcontrols("nameof the othercontrol").text =
        me.list(i%) [[[<<<this should be on line above]]]
   end if
end sub

I have not tested this, so do your own research.  You may have to use
FORM to refresh the form after the change, but I don't think it will
be necesary.

Good Luck,
-Dan

You might



On Thu, 19 Jul 2007 14:09:21 -0400, "LILY"
<LILY.LEADER@DOC.NYC.GOV>
wrote:

>Hi.
>I am a new programmer in SuperBase, version 3.6.
>
>I am making modification to a form from an existing Superbase application.
>
>I need to add a ComboBox to let the user make a selection from the field
>("code") of the Lookup table, that is not linked to the Main
table, which is
>the data source of the form. On this form there is a TextBox with Control
>Source which is a field of the Main table. This field contains the same
>information that is in the field ("code") of the Lookup table.
>
>What should be done so that when a user makes a selection in a ComBobox, it
>will change the data in a TextBox to update the record in the table?
>
>I appreciate in advance.
>
>Lily
>
Post Reply
about | contact