Solved

Forms! Syntax

Posted on 2011-02-18
4
1,004 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

734 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