PC Review


Reply
Thread Tools Rate Thread

Adding custom fields to dynamically created controls.

 
 
leiarose@hotmail.com
Guest
Posts: n/a
 
      3rd Nov 2005
I created a custom Outlook (2003) form that imports data from Access to
populate user defined fields and create additional controls based on
the number of records in an Access query. Everything works fine except
the data the user enters for the dynamically created controls don't
hold their value when the form is sent. I am quessing that is because
there is no user defined fields bound to them. (how do I do this) I
have been looking on the net but cannot find anything close enough. Any
help (examples) would be appreciated.

 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      4th Nov 2005
Look at http://www.outlookcode.com/d/formcontrols.htm, lots of information
there about binding controls to properties.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I created a custom Outlook (2003) form that imports data from Access to
> populate user defined fields and create additional controls based on
> the number of records in an Access query. Everything works fine except
> the data the user enters for the dynamically created controls don't
> hold their value when the form is sent. I am quessing that is because
> there is no user defined fields bound to them. (how do I do this) I
> have been looking on the net but cannot find anything close enough. Any
> help (examples) would be appreciated.
>


 
Reply With Quote
 
leiarose@hotmail.com
Guest
Posts: n/a
 
      4th Nov 2005
I have been all thru there. It is still not working. Here is a piece of
the code that adds the controls if you have any suggestions. Thanks in
advance.


ctrlcount = 0
Do While counter <> recCount
Set Mycmd = Page.Add("Forms.Textbox.1")'name
appRec = "appRec" & ctrlcount
MyCmd.Tag = rst4.Fields(1)
Mycmd.Font.Bold = True
Mycmd.Left = 16
Mycmd.Top = y
Mycmd.Width = 154
Mycmd.Height = 20
Mycmd.Font.Size = 10
Mycmd.Value = rst4.Fields(0)
Mycmd.BackStyle = 0
Mycmd.SpecialEffect = Flat
Mycmd.Locked = True
Set appProp = Iup.Add(appRec, 1)' add field
Iup.Find("appRec").ItemProperty = Mycmd.Tag
Mycmd.ItemProperty = appProp
Set Mycmd = Page.Add("Forms.Checkbox.1")' to visit
ctrlcount = ctrlcount + 1
appRec = "appRec" & ctrlcount
Mycmd.Tag = rst4.Fields(1)
Mycmd.Left = 180
Mycmd.Top = y
Mycmd.Width = 17
Mycmd.Height = 20
Set appProp = Iup.Add(appRec, 6)' add field
Mycmd.ItemProperty = appProp
'there are more controls I took out
loop

 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      7th Nov 2005
Don't add controls using code. It one-offs the form. Design the custom form
and add the controls at design time and bind them to the user properties
then. I didn't notice before that you had specified dynamically created
controls, it's such a bad idea I didn't even consider that's what you wanted
to do.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have been all thru there. It is still not working. Here is a piece of
> the code that adds the controls if you have any suggestions. Thanks in
> advance.
>
>
> ctrlcount = 0
> Do While counter <> recCount
> Set Mycmd = Page.Add("Forms.Textbox.1")'name
> appRec = "appRec" & ctrlcount
> MyCmd.Tag = rst4.Fields(1)
> Mycmd.Font.Bold = True
> Mycmd.Left = 16
> Mycmd.Top = y
> Mycmd.Width = 154
> Mycmd.Height = 20
> Mycmd.Font.Size = 10
> Mycmd.Value = rst4.Fields(0)
> Mycmd.BackStyle = 0
> Mycmd.SpecialEffect = Flat
> Mycmd.Locked = True
> Set appProp = Iup.Add(appRec, 1)' add field
> Iup.Find("appRec").ItemProperty = Mycmd.Tag
> Mycmd.ItemProperty = appProp
> Set Mycmd = Page.Add("Forms.Checkbox.1")' to visit
> ctrlcount = ctrlcount + 1
> appRec = "appRec" & ctrlcount
> Mycmd.Tag = rst4.Fields(1)
> Mycmd.Left = 180
> Mycmd.Top = y
> Mycmd.Width = 17
> Mycmd.Height = 20
> Set appProp = Iup.Add(appRec, 6)' add field
> Mycmd.ItemProperty = appProp
> 'there are more controls I took out
> loop
>


 
Reply With Quote
 
leiarose@hotmail.com
Guest
Posts: n/a
 
      15th Nov 2005
Thanks for responding, sorry about the delay. I don't know how many
controls I will need at design time and they only want the 1 row of
controls per record from the database. I could't figure it any other
way.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamically adding user controls, and then setting custom properties on those instances? Microsoft ASP .NET 6 23rd Dec 2006 09:12 AM
VS2005 ASP.NET 2.0 does not fire event for dynamically created custom web controls Amelyan Microsoft ASP .NET 2 5th Nov 2005 05:29 PM
Adding events to dynamically created controls JezB Microsoft ASP .NET 2 18th Jun 2004 03:54 PM
Adding event handler for dynamically created controls =?Utf-8?B?QW5kcmV3IFdpZWQ=?= Microsoft ASP .NET 3 25th Apr 2004 08:36 PM
Custom User Controls and dynamically created web controls events not firing Nicole Microsoft Dot NET Framework 0 25th Sep 2003 10:40 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:48 AM.