What am I doing wrong? 
Author Message
 What am I doing wrong?

I am customizing the Message form to add two comboboxs, one named
cmbProject and the other cmbTask.  I then want to add these to the subject
separated by a comma.  So I'm doing this:

Function Item_Send()
        Subject = cmbProject.Value & "," & cmbTask.Value & "," & Subject
End Function

I get an error message "Object required cmbProject".  I've checked and
rechecked and the name is correctly spelled.

What am I missing?



Sat, 02 Apr 2005 23:56:16 GMT  
 What am I doing wrong?
You can't refer to controls on Outlook forms like you would in VB or VBA.
You have two options:

1.  Use the fields you have bound to the controls

Item.Subject = Item.UserProperties.Find("fieldname").Value & "," &
Item.UserProperties.Find("fieldname2").Value & "," & Item.Subject

2.  Use the actual controls

Item.Subject =
Item.GetInspector.ModifiedFormPages("PageName").Controls("cmbProject).Value
& "," &
Item.GetInspector.ModifiedFormPages("PageName").Controls("cmbTask).Value &
"," & Item.Subject

(note, any line breaks are included for wrapping, there should be no line
breaks in the code or use the _ syntax for breaking lines)

--
Patricia Cardoza
Outlook MVP
www.cardozasolutions.com

~Please post all replies to the newsgroup~

Quote:
> I am customizing the Message form to add two comboboxs, one named
> cmbProject and the other cmbTask.  I then want to add these to the subject
> separated by a comma.  So I'm doing this:

> Function Item_Send()
> Subject = cmbProject.Value & "," & cmbTask.Value & "," & Subject
> End Function

> I get an error message "Object required cmbProject".  I've checked and
> rechecked and the name is correctly spelled.

> What am I missing?



Sun, 03 Apr 2005 00:12:00 GMT  
 What am I doing wrong?
Option 1 worked great!  Thank you very much for your help.



Quote:
> You can't refer to controls on Outlook forms like you would in VB or
> VBA. You have two options:

> 1.  Use the fields you have bound to the controls

> Item.Subject = Item.UserProperties.Find("fieldname").Value & "," &
> Item.UserProperties.Find("fieldname2").Value & "," & Item.Subject

> 2.  Use the actual controls

> Item.Subject =
> Item.GetInspector.ModifiedFormPages("PageName").Controls("cmbProject).V
> alue & "," &
> Item.GetInspector.ModifiedFormPages("PageName").Controls("cmbTask).Valu
> e & "," & Item.Subject

> (note, any line breaks are included for wrapping, there should be no
> line breaks in the code or use the _ syntax for breaking lines)

> --
> Patricia Cardoza
> Outlook MVP
> www.cardozasolutions.com

> ~Please post all replies to the newsgroup~


>> I am customizing the Message form to add two comboboxs, one named
>> cmbProject and the other cmbTask.  I then want to add these to the
>> subject separated by a comma.  So I'm doing this:

>> Function Item_Send()
>> Subject = cmbProject.Value & "," & cmbTask.Value & "," & Subject
>> End Function

>> I get an error message "Object required cmbProject".  I've checked
>> and rechecked and the name is correctly spelled.

>> What am I missing?



Sun, 03 Apr 2005 00:34:48 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Recordset: What am I doing wrong?

2. What am I doing wrong??

3. What am I doing wrong?

4. Help with syntax. What am I doing wrong

5. What am I doing wrong?

6. What am I doing wrong?

7. What am I doing wrong?

8. What am I doing wrong? -MultiSelect List box

9. Select Case - What am I doing wrong?

10. What am I doing wrong (easy).

11. OLE problem, or what am I doing wrong?

12. Footer/Page # - What am I doing wrong?

 

 
Powered by phpBB® Forum Software