I want to do this from a for/next loop:
DoCmd.OpenForm aryForm2(count), acDesign, , , , acWindowNormal
Temp = aryForm2(count)
Forms!Temp.Section(1).BackColor = Forms!zfrmcolor!color2
The compiler doesn't understand I want to use the variable 'Temp'
instead of a form named "Temp".
How do I get around this?
------
Current code is:
Private Sub cmdColorize_Click()
Dim aryForm2(0) As String
aryForm2(0) = "frmqunioncomp"
Dim frm2end As Integer
Dim count As Integer
Dim temp As String
For count = 0 To UBound(aryForm2)
DoCmd.OpenForm aryForm2(count), acDesign, , , , acWindowNormal
Temp = aryForm2(count)
Forms!Temp.Section(1).BackColor = Forms!zfrmcolor!color2
Next
End Sub
------ 3 1509
Try:
Forms(aryForm2(count)).BackColor = ...
Item is the default collection for forms, so it's an abbreviation of this
kind of construct:
Forms.Item("Form1")
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
<ch************@yahoo.comwrote in message
news:11**********************@f1g2000cwa.googlegro ups.com...
>I want to do this from a for/next loop:
DoCmd.OpenForm aryForm2(count), acDesign, , , , acWindowNormal
Temp = aryForm2(count)
Forms!Temp.Section(1).BackColor = Forms!zfrmcolor!color2
The compiler doesn't understand I want to use the variable 'Temp'
instead of a form named "Temp".
How do I get around this?
------
Current code is:
Private Sub cmdColorize_Click()
Dim aryForm2(0) As String
aryForm2(0) = "frmqunioncomp"
Dim frm2end As Integer
Dim count As Integer
Dim temp As String
For count = 0 To UBound(aryForm2)
DoCmd.OpenForm aryForm2(count), acDesign, , , , acWindowNormal
Temp = aryForm2(count)
Forms!Temp.Section(1).BackColor = Forms!zfrmcolor!color2
Next
End Sub
------
call the string variable something else?
some folks would hang you for not calling them StrTemp and FrmTemp in the
first place
<ch************@yahoo.comwrote in message
news:11**********************@f1g2000cwa.googlegro ups.com...
>I want to do this from a for/next loop:
DoCmd.OpenForm aryForm2(count), acDesign, , , , acWindowNormal
Temp = aryForm2(count)
Forms!Temp.Section(1).BackColor = Forms!zfrmcolor!color2
The compiler doesn't understand I want to use the variable 'Temp'
instead of a form named "Temp".
How do I get around this?
------
Current code is:
Private Sub cmdColorize_Click()
Dim aryForm2(0) As String
aryForm2(0) = "frmqunioncomp"
Dim frm2end As Integer
Dim count As Integer
Dim temp As String
For count = 0 To UBound(aryForm2)
DoCmd.OpenForm aryForm2(count), acDesign, , , , acWindowNormal
Temp = aryForm2(count)
Forms!Temp.Section(1).BackColor = Forms!zfrmcolor!color2
Next
End Sub
------
Allen Brown wrote:
Try:
Forms(aryForm2(count)).BackColor = ...
Item is the default collection for forms, so it's an abbreviation of this
kind of construct:
Forms.Item("Form1")
OMG - it worked!
Thanks Allen! You just saved me a ton of time and code!
- Christian This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Frank Stephan |
last post by:
Hi,
im using Struts with nested tags for form validation.
So I end up with form elements named like this
risikenManuell.praemieNeu
risikenManuell.praemieNeu
....
I would like to do a...
|
by: Jimbo |
last post by:
Hi people,
I am playing with the WSE 2.0 SP3 and am trying to get use the
ReplyTo WS-Addressing header to send a response to a different machine
than where the request came from. However, in my...
|
by: MM |
last post by:
Hi,
I was taught to use this type of class/member construction (some years
ago I might add) -
class someclass
{
private datatype data1;
private datatype data2;
|
by: Stefan Lischke |
last post by:
Hi,
I'm really desperate using code generation(wsdl.exe) from wsdl files for
latest WS-Eventing(including WS-Addressing) Specs.
I'm writing my diploma about "publish subscribe systems based on...
|
by: Hank |
last post by:
My boss wants to be able to set the background color of all forms to
one color that he selects on our Configuration form..
I'd rather not add a function to every form I have and wondered if it...
|
by: Vinny |
last post by:
A customer wants me to convert a VB app I wrote for them into a web app
for remote users to do data entry.
So, I'm writing a small ASP program which prompts the user for data,
much like a VB...
|
by: Alan |
last post by:
I have created a class library say, EmployeeDataDLL.dll. This is a data
access to the backend database.
How do I create an object of the class inside this dll from a Windows form ?
|
by: gerritmitchell |
last post by:
Hi,
I have a situation where I need to send a SOAP message from a receiver
through multiple intermediaries and then to an ultimate receiver. The
intial sender will tell the intermediary where...
|
by: =?Utf-8?B?dWx0cmFuZXQ=?= |
last post by:
We have a client that uses .Net that needs to work against our Java (xfire)
based WS.
My question is: how can a .Net (C#) WS client be configured to not send
WS-Addressing headers? The client in...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |