Solved

Forms! Syntax

Posted on 2011-02-18
4
982 Views
Last Modified: 2012-05-11
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
Comment
Question by:ChuckRush
  • 2
4 Comments
 
LVL 10

Expert Comment

by:VTKegan
ID: 34926210
Forms!frmProgramInformation![PLanner_ID] = Me.NameList

0
 
LVL 10

Expert Comment

by:VTKegan
ID: 34926230
To Get a Form by index you need to place the Parenthesis before the ! like

Forms(wForm)(wField)
0
 
LVL 7

Accepted Solution

by:
kemi67 earned 125 total points
ID: 34926235
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
 

Author Closing Comment

by:ChuckRush
ID: 34926629
Thanks kemi -- i wass missing the controls syntax
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question