Solved

Forms! Syntax

Posted on 2011-02-18
4
963 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
Comment Utility
Forms!frmProgramInformation![PLanner_ID] = Me.NameList

0
 
LVL 10

Expert Comment

by:VTKegan
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks kemi -- i wass missing the controls syntax
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
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…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now