Board index » delphi » Need Delphi Database Help

Need Delphi Database Help

   I'm just starting to use Delphi. Right now I am developing a
database (linked with Paradox 5.0). It runs just fine, but I am having
trouble with a line of code.
        I am wanting to have it so if a certain selection is activated
on a pull down menu (which is linked to a field) a set of things turn
invisible or visible. The code I am thinking I should be using is
something like:

        If DBComboBox1 = 'Life Science' then textbox1.visible = false

Could someone give me the correct syntax. This is approximatly what i'm
using and I get a type mismatch on the then statement.

Joe
dra...@wam.umd.edu

 

Re:Need Delphi Database Help


On mardi 30 avril 1996, Joe Drasin wrote...

Quote
>    I'm just starting to use Delphi. Right now I am developing a
> database (linked with Paradox 5.0). It runs just fine, but I am having
> trouble with a line of code.
>         I am wanting to have it so if a certain selection is activated
> on a pull down menu (which is linked to a field) a set of things turn
> invisible or visible. The code I am thinking I should be using is
> something like:

>         If DBComboBox1 = 'Life Science' then textbox1.visible = false

Well, try               if BDComboBox.Text = 'Life Science' (...)
Quote
> Could someone give me the correct syntax. This is approximatly what i'm
> using and I get a type mismatch on the then statement.

Re:Need Delphi Database Help


Quote
dra...@wam.umd.edu (Joe Drasin) wrote:
>   I'm just starting to use Delphi. Right now I am developing a
>database (linked with Paradox 5.0). It runs just fine, but I am having
>trouble with a line of code.
>        I am wanting to have it so if a certain selection is activated
>on a pull down menu (which is linked to a field) a set of things turn
>invisible or visible. The code I am thinking I should be using is
>something like:
>        If DBComboBox1 = 'Life Science' then textbox1.visible = false
>Could someone give me the correct syntax. This is approximatly what i'm
>using and I get a type mismatch on the then statement.

I guess I'm as new as you, but here's my 2 penorth'.

1.   Even if it worked, what routine will you call to refresh the
display?

2.  I've found that the CreateForm routine sets all .visibles to true.

Re:Need Delphi Database Help


Use the Items property of the combo box to get the required text. Combo
box string values are accessed through the current item's index
DBCombox.Items[DBComboBox.ItemIndex]

Re:Need Delphi Database Help


Quote
>dra...@wam.umd.edu (Joe Drasin) wrote:

>>   I'm just starting to use Delphi. Right now I am developing a
>>database (linked with Paradox 5.0). It runs just fine, but I am
having
>>trouble with a line of code.
>>        I am wanting to have it so if a certain selection is
activated
>>on a pull down menu (which is linked to a field) a set of things turn
>>invisible or visible. The code I am thinking I should be using is
>>something like:

>>        If DBComboBox1 = 'Life Science' then textbox1.visible = false

>>Could someone give me the correct syntax. This is approximatly what
i'm
>>using and I get a type mismatch on the then statement.

this statement should read
     If DBComboBox1.Text = 'Life Science' then
        textbox1.visible := false;

Just keep in mind where your are going to reset to true.

Ben
Arrow

Other Threads