A Microsoft Outlook email forum. Outlook Banter

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   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

IS this possible?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 9th 07, 08:49 PM posted to microsoft.public.outlook.program_vba
Ayo
external usenet poster
 
Posts: 1
Default IS this possible?

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  
Old May 10th 07, 09:29 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default IS this possible?

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
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:21 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.