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

Counter stops at 6



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 20th 07, 03:43 PM posted to microsoft.public.outlook.program_vba
greg
external usenet poster
 
Posts: 91
Default Counter stops at 6

Hi,

I have creeated a custom task form that populates a variable number of
fields from an excel sheet.

I have fields on the form labeled PO1; PO2; PO3; etc. and I use a counter
to identify the next field to populate. (seen below)

Do While cust1 = ActiveSheet.Cells(row1 + 6, 3) And prod1 =
ActiveSheet.Cells(row1 + 6, 6)
row1 = row1 + 6
counter = counter + 1

.UserProperties("PO Number" & counter).Value = ActiveSheet.Cells(row1, 2)
.UserProperties("QTY" & counter).Value = ActiveSheet.Cells(row1, 10)
MyItem.GetInspector.ModifiedFormPages("POs Affected").Controls("PO Number"
& counter).Visible = True
MyItem.GetInspector.ModifiedFormPages("POs Affected").Controls("QTY" &
counter).Visible = True
Loop

My fileds are named correctly; my row counting is correct; and the counter
works from PO1 to PO5. However, the macro hits an error on PO6 and stops.

Any ideas why it stops at 6?

THank you.

Ads
  #2  
Old March 21st 07, 06:51 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Counter stops at 6



What does the error message say?

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Quick-Cats - The most effective way to assign Outlook categories:
http://www.shareit.com/product.html?...4&languageid=1
(German: http://www.VBOffice.net/product.html?pub=6)

Am Tue, 20 Mar 2007 07:43:05 -0700 schrieb greg:

Hi,

I have creeated a custom task form that populates a variable number of
fields from an excel sheet.

I have fields on the form labeled PO1; PO2; PO3; etc. and I use a counter
to identify the next field to populate. (seen below)

Do While cust1 = ActiveSheet.Cells(row1 + 6, 3) And prod1 =
ActiveSheet.Cells(row1 + 6, 6)
row1 = row1 + 6
counter = counter + 1

.UserProperties("PO Number" & counter).Value = ActiveSheet.Cells(row1, 2)
.UserProperties("QTY" & counter).Value = ActiveSheet.Cells(row1, 10)
MyItem.GetInspector.ModifiedFormPages("POs Affected").Controls("PO

Number"
& counter).Visible = True
MyItem.GetInspector.ModifiedFormPages("POs Affected").Controls("QTY" &
counter).Visible = True
Loop

My fileds are named correctly; my row counting is correct; and the counter
works from PO1 to PO5. However, the macro hits an error on PO6 and stops.

Any ideas why it stops at 6?

THank you.

  #3  
Old March 21st 07, 03:20 PM posted to microsoft.public.outlook.program_vba
greg
external usenet poster
 
Posts: 91
Default Counter stops at 6

I recieve the error message:
"Run-time error '91':
Object variable or With block variable not set"

I hit this error on the sixth time through the loop on the

..UserProperties("PO Number"..........line.


"Michael Bauer [MVP - Outlook]" wrote:



What does the error message say?

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Quick-Cats - The most effective way to assign Outlook categories:
http://www.shareit.com/product.html?...4&languageid=1
(German: http://www.VBOffice.net/product.html?pub=6)

Am Tue, 20 Mar 2007 07:43:05 -0700 schrieb greg:

Hi,

I have creeated a custom task form that populates a variable number of
fields from an excel sheet.

I have fields on the form labeled PO1; PO2; PO3; etc. and I use a counter
to identify the next field to populate. (seen below)

Do While cust1 = ActiveSheet.Cells(row1 + 6, 3) And prod1 =
ActiveSheet.Cells(row1 + 6, 6)
row1 = row1 + 6
counter = counter + 1

.UserProperties("PO Number" & counter).Value = ActiveSheet.Cells(row1, 2)
.UserProperties("QTY" & counter).Value = ActiveSheet.Cells(row1, 10)
MyItem.GetInspector.ModifiedFormPages("POs Affected").Controls("PO

Number"
& counter).Visible = True
MyItem.GetInspector.ModifiedFormPages("POs Affected").Controls("QTY" &
counter).Visible = True
Loop

My fileds are named correctly; my row counting is correct; and the counter
works from PO1 to PO5. However, the macro hits an error on PO6 and stops.

Any ideas why it stops at 6?

THank you.


  #4  
Old March 22nd 07, 07:13 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Counter stops at 6



Ok, that means that

.UserProperties("PO Number" & 6)

doesn't exist.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Quick-Cats - The most effective way to assign Outlook categories:
http://www.shareit.com/product.html?...4&languageid=1
(German: http://www.VBOffice.net/product.html?pub=6)

Am Wed, 21 Mar 2007 07:20:50 -0700 schrieb greg:

I recieve the error message:
"Run-time error '91':
Object variable or With block variable not set"

I hit this error on the sixth time through the loop on the

.UserProperties("PO Number"..........line.


"Michael Bauer [MVP - Outlook]" wrote:



What does the error message say?

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Quick-Cats - The most effective way to assign Outlook categories:
http://www.shareit.com/product.html?...4&languageid=1
(German: http://www.VBOffice.net/product.html?pub=6)

Am Tue, 20 Mar 2007 07:43:05 -0700 schrieb greg:

Hi,

I have creeated a custom task form that populates a variable number of
fields from an excel sheet.

I have fields on the form labeled PO1; PO2; PO3; etc. and I use a

counter
to identify the next field to populate. (seen below)

Do While cust1 = ActiveSheet.Cells(row1 + 6, 3) And prod1 =
ActiveSheet.Cells(row1 + 6, 6)
row1 = row1 + 6
counter = counter + 1

.UserProperties("PO Number" & counter).Value = ActiveSheet.Cells(row1,

2)
.UserProperties("QTY" & counter).Value = ActiveSheet.Cells(row1, 10)
MyItem.GetInspector.ModifiedFormPages("POs Affected").Controls("PO

Number"
& counter).Visible = True
MyItem.GetInspector.ModifiedFormPages("POs Affected").Controls("QTY" &
counter).Visible = True
Loop

My fileds are named correctly; my row counting is correct; and the

counter
works from PO1 to PO5. However, the macro hits an error on PO6 and

stops.

Any ideas why it stops at 6?

THank you.


  #5  
Old March 22nd 07, 04:25 PM posted to microsoft.public.outlook.program_vba
greg
external usenet poster
 
Posts: 91
Default Counter stops at 6

It was issue with the custom form. My problem has been resolved

"greg" wrote:

Hi,

I have creeated a custom task form that populates a variable number of
fields from an excel sheet.

I have fields on the form labeled PO1; PO2; PO3; etc. and I use a counter
to identify the next field to populate. (seen below)

Do While cust1 = ActiveSheet.Cells(row1 + 6, 3) And prod1 =
ActiveSheet.Cells(row1 + 6, 6)
row1 = row1 + 6
counter = counter + 1

.UserProperties("PO Number" & counter).Value = ActiveSheet.Cells(row1, 2)
.UserProperties("QTY" & counter).Value = ActiveSheet.Cells(row1, 10)
MyItem.GetInspector.ModifiedFormPages("POs Affected").Controls("PO Number"
& counter).Visible = True
MyItem.GetInspector.ModifiedFormPages("POs Affected").Controls("QTY" &
counter).Visible = True
Loop

My fileds are named correctly; my row counting is correct; and the counter
works from PO1 to PO5. However, the macro hits an error on PO6 and stops.

Any ideas why it stops at 6?

THank you.

 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Character Counter Paltrinieri Alejandro Outlook - Using Forms 0 March 14th 07 07:02 PM
Calendar stops working easouza Outlook - Calandaring 1 February 23rd 07 06:50 AM
Newsgroups unread items counter Rostislav Yevdyukhin Outlook - General Queries 2 October 20th 06 11:42 AM
Outlook 2004- where is counter for contact number of address? bpulpit Outlook - Using Contacts 1 October 17th 06 10:00 PM
how do i make a counter in an outlook form? Wassan Outlook - Using Forms 1 May 27th 06 03:21 PM


All times are GMT +1. The time now is 06:59 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.