Solved

How can I do the following with VBA to a MS Access report?

Posted on 2011-02-10
3
215 Views
Last Modified: 2012-05-11
How can I create a text boxes dynamically and assign them a field name based on tables in a field?
0
Comment
Question by:kosenrufu
3 Comments
 
LVL 33

Accepted Solution

by:
jppinto earned 500 total points
ID: 34866340
0
 
LVL 31

Expert Comment

by:Helen_Feddema
ID: 34866357
Generally speaking, it is easier to just drag the fields to the report, then rename them automatically with my LNC Rename add-in.  The Access 2000-2003 version can be downloaded from this link:
http://www.helenfeddema.com/Files/code10.zip

and the Access 2007-2010 version from this link:
http://www.helenfeddema.com/Files/code63.zip


(unless there is something I am missing -- if so, please give more details on exactly what you are doing here)
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 34899058
Although this can be done, as you can see by the code jppinto posted, it is not what I would call "Easy"

Please remember that adding controls at runtime will decompile your application.
(How are you planning to recompile your code automatically?)

Also note that this WILL NOT work in an MDE file or the Access Runtime.
These are two of the most popular ways of running Access applications, so you may be doing all the work for naught...

Finally, in a global sense, this is rarely done...

Like Helen, I would like to know a little more about what you are trying to do here and why.

Perhaps there is a less complex alternative...


JeffCoachman
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Suggested Solutions

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

746 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