473,320 Members | 2,189 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,320 software developers and data experts.

Dynamic Control Creation

I know that In VB6 it is possible to add controls to a form dynamically at runtime byisetting an existing controls index property to some number and then creating new controls as part of a control array. Controls in Access don't have an index property however. In other Office applications, it is possible to create controls dynamically using Me.Controls.Add(). In Access Me.Controls only has four options: Application, Count, Item, and Parent. There is not .Add in MS Access.

So, is there a method by which to create controls dynamically using VBA in MS Access?
Mar 26 '07 #1
5 8567
Rabbit
12,516 Expert Mod 8TB
I know that In VB6 it is possible to add controls to a form dynamically at runtime byisetting an existing controls index property to some number and then creating new controls as part of a control array. Controls in Access don't have an index property however. In other Office applications, it is possible to create controls dynamically using Me.Controls.Add(). In Access Me.Controls only has four options: Application, Count, Item, and Parent. There is not .Add in MS Access.

So, is there a method by which to create controls dynamically using VBA in MS Access?
The only way to do this is you have to open the form in design view, make the controls, and then reload the form in normal view.
Mar 26 '07 #2
MMcCarthy
14,534 Expert Mod 8TB
Controls can be added to a Form in VBA using Application.CreateControl but only when the Form is opened in Design View.

Therefore you would have to open the form in design view, add your control and then close the form. Too many instances of this would be a heavy load on the database.

Normally you would just add all the controls you might need to the form and toggle them visible or invisible depending on your needs.

Mary
Mar 26 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
Here is the msdn instructions on using the CreateControl method in case you want to use it.

http://msdn2.microsoft.com/en-us/library/aa221167(office.11).aspx

Mary
Mar 26 '07 #4
Thanks all for the replies. Unfortunately I might just have to write this program using VB6 at some later point since I require being able to built a dynamic map (I work for a city and the portions of the map are being changed constantly).

Thank you all none the less!
Mar 26 '07 #5
Rabbit
12,516 Expert Mod 8TB
Thanks all for the replies. Unfortunately I might just have to write this program using VB6 at some later point since I require being able to built a dynamic map (I work for a city and the portions of the map are being changed constantly).

Thank you all none the less!
What about using GIS?
Mar 26 '07 #6

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

Similar topics

3
by: Eddie de Bear | last post by:
Hi, A project I am working on has a requirement for dynamic menus. For the most part this works really well. The menus I'm creating a based on files and directories, so naturally the menu...
2
by: charliewest | last post by:
I need to create textboxes in real-time, the actual number of which is determine by a result from a database query. I have been able to create the controls, and then add them to the ASPX page....
2
by: Dave Williamson | last post by:
When a ASPX page is created with dynamic controls based on what the user is doing the programmer must recreate the dynamic controls again on PostBack in the Page_Load so that it's events are wired...
4
by: spx27 | last post by:
Does anyone know the best way to handle passing a dynamic menu generated from a login from one asp.net page to another. Would it be better to recreate the menu on each page? Save the menu as a...
1
by: Homam | last post by:
So I have a composite paging control that shoulld be positioned on the page like this: PagNav ResultSetDisplay PagNav I know that I can't resuse the PagNav more than once in the form, so I...
3
by: vodafone | last post by:
Hy all I've a little problem. I need to write a dynamic page that render control according to validation status return from previous control validation status. To be clear, I've page that...
0
by: Prodip K Saha | last post by:
Many Programmers stay away from loading User Control dynamically on the Web Form because of the complexity associated with it's state management and event handling. It is easy to load a User...
0
by: Paul | last post by:
Hi! I have been wondering about a design issue for some time now and hope someone can help sort this one out for me. Say you have to create some webcontrols dynamically. Each controls creation...
13
by: rn5a | last post by:
In a shopping cart app, suppose a user has placed 5 orders, I want to show him 5 LinkButtons (one for each order) so that when he clicks the first LinkButton, he would be shown the details of his...
1
by: cdmsenthil | last post by:
I have an Infragistics UltrawebGrid . Each Row in the grid is attached to a context menu using Infragistics CSOM Upon click on the menu, I am creating an Iframe dynamically which points to...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.