Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Forms! Syntax

Posted on 2011-02-18
4
Medium Priority
?
1,013 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 500 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

670 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