473,405 Members | 2,160 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Referencing Array elements on A form

38
I'd like to create a form that populates an Array directly instead of writing the code to move individual controls values to an array. Is that even possible?
Thank you in advance.
Salzan
Feb 10 '08 #1
2 1783
MMcCarthy
14,534 Expert Mod 8TB
If as I think you mean binding a form to an array then the answer is no. However, you could set up a table to hold the array positions, one to each column and bind the form to that table. This is probably not the most practical way to do this however.

If all the controls on the form represent positions in the array you could always look through the controls on the form quickly using a form loop. In fact controls on a form are an array by default but this includes labels etc.

Something like ...
Expand|Select|Wrap|Line Numbers
  1. Dim frm As Form
  2. Dim ctl As Control
  3.  
  4. For each ctl in frm.Controls
  5.     If TypeName(ctl) ="TextBox" Then
  6.         ' do something here to pass values to array
  7.     End If
  8. Next ctl 
Feb 10 '08 #2
ADezii
8,834 Expert 8TB
I'd like to create a form that populates an Array directly instead of writing the code to move individual controls values to an array. Is that even possible?
Thank you in advance.
Salzan
Hello Salzan, I think what you may be referring to, especially if you're a VBer, are Control Arrays, if so you are out of luck since VBA does not support them. If this is not your intention, simply ignore this statement. Just for curiosity, what exactly are you trying to achieve?
Feb 11 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Herrcho | last post by:
in K&R Chapter 6.3 it mentions two methods to calculate NKEYS. and points out the first one which is to terminate the list of initializers with a null pointer, then loop along keytab until the...
3
by: trevorelbourne | last post by:
Hi, I am having trouble accessing the elements of an array using reflection. This is the code I am having trouble with: FieldInfo Fields = Obj.GetType().GetFields(); foreach (FieldInfo fi in...
8
by: ljlevend2 | last post by:
If a property's type is an array and the property is exposed in a PropertyGrid, then the property can be expanded so that the user can view and edit the array elements. But, I've noticed that if...
24
by: RyanTaylor | last post by:
I have a final coming up later this week in my beginning Java class and my prof has decided to give us possible Javascript code we may have to write. Problem is, we didn't really cover JS and what...
6
by: Kumar | last post by:
How should I declare the array elements being half word? and the array elements of the type byte in C?? Please help Kumar
8
by: SP | last post by:
The following code crashes after I add the two nested FOR loops at the end, I am starting to learn about pointers and would like to understand what I'm doing wrong. I think the problem is the way...
1
by: koval | last post by:
Type mismatch error occured when calling HTML array elements through Request.form("txtlrno" & i) after self posting the form, please anyone help me immediately because is in crisis.
14
by: dan | last post by:
I would like to have the preprocessor automatically generate the number of array elements requested. Each element is zero. The elements get pasted into a larger array. The other elements may be...
2
by: awaisworld13 | last post by:
I want to write a program which take input and save the poistions of the array elements in another array. let if i enter an array A= 4 A=1 A=2 A=3 now the output array will hold 1 2 3
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
Oralloy
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.