Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1017
  • Last Modified:

Forms! Syntax

I am trying to replace the formname and the control name in the following statement

'Forms!frmProgramInformation!("PLanner_ID") = Me.NameList

This is from a popup form that searches a employee list and return a name to the main form.  I would like to use this in serval forms with many fields
dim wForm as string
dim wField as string
I have tried  FORMS!(wform)!(wField) = me.namelist
0
ChuckRush
Asked:
ChuckRush
  • 2
1 Solution
 
VTKeganCommented:
Forms!frmProgramInformation![PLanner_ID] = Me.NameList

0
 
VTKeganCommented:
To Get a Form by index you need to place the Parenthesis before the ! like

Forms(wForm)(wField)
0
 
kemi67Commented:
If I have well understood, you are trying to do this
Dim wForm As String
Dim wField As String
wForm = "NameOfTheForm"
wField = "NameOfTheControl"
Forms(wForm).Controls(wField) = "DesiredValue"

Open in new window

0
 
ChuckRushAuthor Commented:
Thanks kemi -- i wass missing the controls syntax
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now