![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I have a form with option buttons, 1 combobox, 1 textbox and a few buttons.
What I am trying to do is to get a value and put it in the textbox based on what is in the combobox and what is selected from the option button. My problem is that when I select an option and input a value into the combox, the text box is still empty. What am I doing wrong? For Each optProject In fraProject.Controls If optProject.Enabled = True And optProject.Value = True Then ActiveSheet.Range("B1").Value = frmReport.cboSiteID.Value ActiveSheet.Range("G1").Value = Mid(optProject.Name, 4, 6) If Left(ActiveSheet.Range("G1").Value, 1) = 8 Then ActiveSheet.Range("G1").numberFormat = "000000" ElseIf Left(ActiveSheet.Range("G1").Value, 1) 8 Then ActiveSheet.Range("G1").numberFormat = "00000" End If For Each c In Worksheets("Key").Range("B:B").Cells If IsNull(frmReport.txtTask.Value) Then If c.Value = frmReport.cboSiteID.Value Then If c.Offset(0, -1).Value = Mid(optProject.Name, 4, 6) _ Or c.Offset(0, -1).Value = Mid(optProject.Name, 4, 5) Then frmReport.txtTask.Value = c.Offset(0, 1).Value Exit For End If End If ElseIf Not IsNull(frmReport.txtTask.Value) Then Exit For End If Next ActiveSheet.Range("I1").Value = frmReport.txtTask.Value ActiveSheet.Range("I1").numberFormat = "0000" ActiveSheet.Range("K1").Value = Date End If Next optProject |
Ads |
#2
|
|||
|
|||
![]()
ActiveSheet suggests that maybe you meant to post this in an Excel forum rather than an Outlook forum? When you post it in an Excel group, you might want to include information about the Excel version and what event handler or procedure is actually running this code.
-- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Ayo" wrote in message ... I have a form with option buttons, 1 combobox, 1 textbox and a few buttons. What I am trying to do is to get a value and put it in the textbox based on what is in the combobox and what is selected from the option button. My problem is that when I select an option and input a value into the combox, the text box is still empty. What am I doing wrong? For Each optProject In fraProject.Controls If optProject.Enabled = True And optProject.Value = True Then ActiveSheet.Range("B1").Value = frmReport.cboSiteID.Value ActiveSheet.Range("G1").Value = Mid(optProject.Name, 4, 6) If Left(ActiveSheet.Range("G1").Value, 1) = 8 Then ActiveSheet.Range("G1").numberFormat = "000000" ElseIf Left(ActiveSheet.Range("G1").Value, 1) 8 Then ActiveSheet.Range("G1").numberFormat = "00000" End If For Each c In Worksheets("Key").Range("B:B").Cells If IsNull(frmReport.txtTask.Value) Then If c.Value = frmReport.cboSiteID.Value Then If c.Offset(0, -1).Value = Mid(optProject.Name, 4, 6) _ Or c.Offset(0, -1).Value = Mid(optProject.Name, 4, 5) Then frmReport.txtTask.Value = c.Offset(0, 1).Value Exit For End If End If ElseIf Not IsNull(frmReport.txtTask.Value) Then Exit For End If Next ActiveSheet.Range("I1").Value = frmReport.txtTask.Value ActiveSheet.Range("I1").numberFormat = "0000" ActiveSheet.Range("K1").Value = Date End If Next optProject |
Thread Tools | Search this Thread |
Display Modes | |
|
|