If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > display text field when select item in combo box

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-11-04, 23:28
azifa7980 azifa7980 is offline
Registered User
 
Join Date: Aug 2004
Posts: 15
display text field when select item in combo box

hi,
i am beginner user of vb. i create one combo box with this items:-
1. change component
2. change ic
3. align component
when i select the (2) item - change ic, the form will show 2 text fields to me
1. ic part no.
2. new lot code
(temporary i enabled the 2 text fields before i select the (2) item - change ic)
so, can you help me show how to write the full coding.
thank you.
Reply With Quote
  #2 (permalink)  
Old 08-11-04, 23:33
azifa7980 azifa7980 is offline
Registered User
 
Join Date: Aug 2004
Posts: 15
detect every station pc no. in network

hi,
using vb, if there a way i can detect every station pc no. in network when i go to login page then display another form, vb can detect the station no. and show it at the form header?

thank you.
Reply With Quote
  #3 (permalink)  
Old 08-12-04, 09:45
Daniel_Johns Daniel_Johns is offline
Registered User
 
Join Date: Jul 2004
Posts: 69
Quote:
Originally Posted by azifa7980
hi,
i am beginner user of vb. i create one combo box with this items:-
1. change component
2. change ic
3. align component
when i select the (2) item - change ic, the form will show 2 text fields to me
1. ic part no.
2. new lot code
(temporary i enabled the 2 text fields before i select the (2) item - change ic)
so, can you help me show how to write the full coding.
thank you.
is it you disabled the 2 text fields or just hide it? if you just disabled it then just enabled it (look at my sample) and if it was invisible, make it visible by changing the visible property to True.

Private Sub cmbItems_Click()
If cmbItems.ListIndex = 1 Then 'index starts at 0 so the 2nd item will be 1
txtIC_Part_No.Enabled = True
txtNew_Lot_Code.Enabled = True
End If
End Sub

Hope this is what you meant.
Reply With Quote
  #4 (permalink)  
Old 08-12-04, 09:50
Daniel_Johns Daniel_Johns is offline
Registered User
 
Join Date: Jul 2004
Posts: 69
Quote:
Originally Posted by azifa7980
hi,
i am beginner user of vb. i create one combo box with this items:-
1. change component
2. change ic
3. align component
when i select the (2) item - change ic, the form will show 2 text fields to me
1. ic part no.
2. new lot code
(temporary i enabled the 2 text fields before i select the (2) item - change ic)
so, can you help me show how to write the full coding.
thank you.
is it you disabled the 2 text fields or just hide it? if you just disabled it then just enabled it (look at my sample) and if it was invisible, make it visible by changing the visible property to True.

Private Sub cmbItems_Click()
If cmbItems.ListIndex = 1 Then 'index starts at 0 so the 2nd item will be 1
txtIC_Part_No.Enabled = True
txtNew_Lot_Code.Enabled = True
End If
End Sub

Hope i did help you.
Reply With Quote
  #5 (permalink)  
Old 08-12-04, 23:32
azifa7980 azifa7980 is offline
Registered User
 
Join Date: Aug 2004
Posts: 15
an error!!

i have tried what are you suggested to me. but i found an error here.

A Compile Error:
Method or data member not found.

what i suppose to do now? please help me!
Reply With Quote
  #6 (permalink)  
Old 08-15-04, 11:15
Daniel_Johns Daniel_Johns is offline
Registered User
 
Join Date: Jul 2004
Posts: 69
huh? well, here's a sample for you. (dont know how come it was an error!)

Private Sub Combo1_Click()
If Combo1.ListIndex = 1 Then
Text1.Enabled = True
Text2.Enabled = True
Else
Text1.Enabled = False
Text2.Enabled = False
End If
End Sub

Private Sub Form_Load()
Text1.Enabled = False
Text2.Enabled = False
With Combo1
.AddItem "Change Component"
.AddItem "Change IC"
End With
End Sub

First, ive created a combobox (Combo1) then 2 textboxes (Text1 & Text2)

Then in the Form_Load event, i add 2 items in the combobox, the "Change Component" and "Change IC" and set the 2 textboxes in disabled mode.

In the Combo1_Click event, since you decided that if we select the 2nd choice or item, which is Change IC, (ive explained why i use ListIndex =1 in my previous post) then enabled the 2 textboxes, otherwise, if the user select the first item, then it'll be disabled again.

Hope this will help u.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On