LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Updating value in form text box based on combo box input

I have a form that I load with data from a worksheet, the loading of
the data works fine, see abbreviated code below.

To perform some further evaluation I added some text and combo boxes to
the form, see code at bottom, with the selection from the combo box
PartType of either "Blank" or "Finished" and the listbox PartSize of
certain size I want to apply a cycle time into the text box
PartPrepTime using if statements (for simplicity purposes I only show 2
if statements, but I will enter about 16 in total when complete). The
added code seems to work, it populates the combo box and allows me to
select, I can enter a value into the PartSize text box, but nothing is
diplayed in the text box PartPrepTime. I must be doing something real
stupid can anyone help.

Regards
burl_h

start existing code...........
Private Sub Userform_Initialize()
Dim myVar(1 To 62) As Variant


With frmQuoteForm.ComboBox1
myVar1 = .List(.ListIndex, 0)
myVar2 = .List(.ListIndex, 1)
....
....
myVar62 = .List(.ListIndex, 110)
End With

frmQuoteForm.txtQuote.Value = myVar1
frmQuoteForm.txtExtAttrib.Value = myVar2
......
......
frmQuoteForm.txtMisc.Value = myVar62

end existing code............


added code.........

Dim arrPartType(1 To 2)
arrPartType(1) = "Blank"
arrPartType(2) = "Finished"

Dim EntryCount As Long
For EntryCount = 1 To 2
ComboBoxPartType.AddItem arrPartType(EntryCount)
Next

If Me.ComboBoxPartType = "Blank" And Me.txtPartSize.Value <= 2.0 Then
Me.txtPartPrepTime.Value = "5.0 minutes"
End If

If Me.ComboBoxPartType = "Blank" And Me.txtPartSize.Value <= 4.0 Then
Me.txtPartPrepTime.Value = "8.0 minutes"
End If

end added code...........


End Sub

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to select a specific range based on the time value of user form input Jitranijam New Users to Excel 8 November 15th 06 12:52 AM
specify a specific column to input text based on another cell's content jsd219 Excel Programming 10 October 27th 06 11:04 PM
Updating cell values on sheet based on selected combo box value Buster Excel Programming 0 October 21st 06 12:54 AM
Web Qery Based On Form Field Input netbrink Excel Programming 3 April 15th 06 08:25 PM
Change the size of text used in a Form combo box Mark Excel Discussion (Misc queries) 0 April 11th 06 03:08 PM


All times are GMT +1. The time now is 06:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"