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 - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Dynamic fields on forms



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5  
Old September 28th 09, 09:02 AM posted to microsoft.public.outlook.program_forms
John Bacon
external usenet poster
 
Posts: 9
Default Dynamic fields on forms

Sue,
Thanks for that info. Strange thing is I started in that group and got
directed to this one. Anyway I've got the solution so that's the most
important thing.

"Sue Mosher [MVP]" wrote:

Outlook custom forms are the UI/code templates for Outlook message, contact,
and other items. They're quite different from VBA user forms. Questions
about those go in the microsoft.public.outlook.program_vba newsgroup.

And, please, always include your version of Outlook when you post.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"John Bacon" wrote in message
...
Well in my eyes it's a formin OUTLOOK customised by VBA, but maybe I don't
understand what Outlook custom forms implies, in which case please point
me
to the correct forum in case I get another problem in future.
Thanks.

"Sue Mosher [MVP]" wrote:

Sorry, but I don't see what this has to do with Outlook custom forms.

"John Bacon" wrote in message
...
I need to have a variable number of fields on a form with different
names
based upon an array of names
I've succesfully built the form using the code below InitUserFields .
UF
is
a dynamic array of field names UFV is a matching array of initial
values
for
each field.

Now I need to retrieve the values that the user enters into the form
and
store them back in UFV.

I've tried to use EXECUTE & EVAL as shown in the sub GetUserFields but
I
get the error sub or function not defined on ECECUTE or EVAL whichever
I
use.
I've included references to VB Applications Extensibility 5.3 and Excel
11.0
Object library without any difference.
Does anyone have a better idea of how to achieve this?

Sub InitUserFields(UF, UFV)
Dim X As Integer
Dim NewLabel, NewTextbox
For X = 0 To UBound(UF)
Set NewLabel = Me.Controls.Add("Forms.label.1")
With NewLabel
.Name = UF(X).Name & "Title"
.Caption = UF(X).Name
.Top = 252
.Left = 366 + X * 94
.Width = 90
.Height = 12
.Font.Name = "Tahoma"
End With
Set NewTextbox = Me.Controls.Add("Forms.textbox.1")
With NewTextbox
.Name = UF(X).Name
.Value = UFV(X)
.Top = 264
.Left = 366 + X * 94
.Width = 90
.Height = 15.75
.Font.Name = "Tahoma"
End With
Next
End Sub




Sub GetUserFields(UF, UFV)
Dim X As Integer
For X = 0 To UBound(UF)
Execute (UFV(X) = "Me." & UF(X).Name & ".Value")
Next
End Sub






 




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
User Defined Fields and Custom Forms dch3 Outlook - Using Forms 2 August 30th 07 03:34 PM
How do I upload Custom fields into my Outlook Forms? madmack Outlook - Using Contacts 1 May 2nd 07 11:03 PM
Importing Custom Fields & Creating Forms Simon Outlook - Using Forms 1 October 27th 06 12:38 PM
Some fields cannot be edited on "All Fields" tab on Contact forms BR Outlook - Using Contacts 1 February 19th 06 07:54 PM
Fields on custom forms are not kept after message is sent Sue Mosher [MVP-Outlook] Outlook - Using Forms 2 February 6th 06 10:06 PM


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