Can code stored in a table be used to dynamically fill an unbound textbox in an Access reportAccess: Canceling Report generation causes error 2501how to add a dynamic date filter to Access reportDLookup in ControlSource property of a TextBoxDynamic report in MS access will not update with source queryHow can I display the Max (DMax) of a Field on an MS Access Report?How to Split a text string into multiple table fieldsHow to store values in an access database from a series of textboxes, labels?How can I display an image in a ms access 2013 report using relative paths stored in a field of a databaseStore Multiple Values in a Single Textbox in Microsoft AccessMy Table is not updating with the second entries in Long Text field

Why does the U.S. tolerate foreign influence from Saudi Arabia and Israel on its domestic policies while not tolerating that from China or Russia?

Changing trains in the Netherlands

Generating random numbers that keep a minimum distance

Credit score and financing new car

Would dual wielding daggers be a viable choice for a covert bodyguard?

How many hours would it take to watch all of Doctor Who?

Machine learning and operations research projects

Why didn't Thanos kill all the Dwarves on Nidavellir?

Are randomly-generated passwords starting with "a" less secure?

Are there any sports for which the world's best player is female?

Professor falsely accusing me of cheating in a class he does not teach, 2 months after end of the class. What precautions should I take?

What steps should I take to lawfully visit the United States as a tourist immediately after visiting on a B-1 visa?

How can one write good dialogue in a story without sounding wooden?

Why isn't pressure filtration popular compared to vacuum filtration?

What's the point of having a RAID 1 configuration over incremental backups to a secondary drive?

Constructive proof of existence of free algebras for infinitary equational theories

How can I get a player to accept that they should stop trying to pull stunts without thinking them through first?

Why was hardware diversification an asset for the IBM PC ecosystem?

What was the definition of "set" that resulted in Russell's Paradox

Why does it output Integers instead of letters?

Is "I do not want you to go nowhere" a case of "DOUBLE-NEGATIVES" as claimed by Grammarly?

How can I calculate the sum of 2 random dice out of a 3d6 pool in AnyDice?

How to properly say "bail on somebody" in German?

Are unclear "take-it or leave-it" contracts interpreted in my favor?



Can code stored in a table be used to dynamically fill an unbound textbox in an Access report


Access: Canceling Report generation causes error 2501how to add a dynamic date filter to Access reportDLookup in ControlSource property of a TextBoxDynamic report in MS access will not update with source queryHow can I display the Max (DMax) of a Field on an MS Access Report?How to Split a text string into multiple table fieldsHow to store values in an access database from a series of textboxes, labels?How can I display an image in a ms access 2013 report using relative paths stored in a field of a databaseStore Multiple Values in a Single Textbox in Microsoft AccessMy Table is not updating with the second entries in Long Text field






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I have an access table that I want to use to make a dynamic template for building a report. How do I use the values stored in that table in the report? As the programmer, I know how to manually write the code in the report...BUT...I want to store the information in a table instead of hard coding it, to give the USER the ability to modify the template of the report, long after I've gone.



Specifically:



  • Enter this in table: 1. The person of interest is [First] [Last]

  • I will use code to modify the user entered value as: "1. The person of interest is " & [First] & " " & [Last]

  • In the Report, I want the unbound textbox to pull the information stored in the table to change the ControlSource so that when the report runs you get the desired outcome: 1. The person of interest is John Doe

I have tried using MyText.ControlSource = [TemplateField], but all this does is makes the report show the contents of the text field. I'm guessing I need to escape the code in some way so that the report reads the items in "[ ]" as code vice text, but I can't figure out how to do that while storing it at the same time.










share|improve this question
























  • Textbox does not have RecordSource, it has ControlSource. When setting ControlSource, static text part needs to be enclosed in quote marks. The example you show is missing the opening quote mark. However, setting to a field that holds static text and field names will just be seen as a single string, which is what you are experiencing. I don't know any way to accomplish what you want - no way to 'escape' and evaluate as field name references. Just need to build report with necessary static content (labels) and textboxes bound to fields.

    – June7
    Mar 26 at 4:26











  • Thanks for the corrections.. I fixed for any future readers.

    – jeremyssmith
    Mar 26 at 4:54











  • What event did you even use to set textbox ControlSource? I think what you wanted would be even more complicated for users. Would they have to know to include [ ] characters appropriately in typed input?

    – June7
    Mar 26 at 5:26











  • My example above is way simplified.. I used a form that allows the user to type free text, and then from a combo box they choose the field to enter. Each time the combo changes (afterupdate) I run vb to fill the textbox. It actually works beautifully.. up until I can't use the data for anything.

    – jeremyssmith
    Mar 26 at 5:55











  • I figured a way I could do it.. it works, but it's not as clean as I'd like it to be. The user "builds" the template using the form I already created- and then when all the textboxes are filled (there are many dynamic portions of this report)- I can use vb to cycle through the textbox and break out each text field (by searching for the [ ]) and then change the controlsource of the textfield in the saved report. Then.. when I call the report (from another form) it would just be filling in the data like a normal report.

    – jeremyssmith
    Mar 26 at 6:00

















0















I have an access table that I want to use to make a dynamic template for building a report. How do I use the values stored in that table in the report? As the programmer, I know how to manually write the code in the report...BUT...I want to store the information in a table instead of hard coding it, to give the USER the ability to modify the template of the report, long after I've gone.



Specifically:



  • Enter this in table: 1. The person of interest is [First] [Last]

  • I will use code to modify the user entered value as: "1. The person of interest is " & [First] & " " & [Last]

  • In the Report, I want the unbound textbox to pull the information stored in the table to change the ControlSource so that when the report runs you get the desired outcome: 1. The person of interest is John Doe

I have tried using MyText.ControlSource = [TemplateField], but all this does is makes the report show the contents of the text field. I'm guessing I need to escape the code in some way so that the report reads the items in "[ ]" as code vice text, but I can't figure out how to do that while storing it at the same time.










share|improve this question
























  • Textbox does not have RecordSource, it has ControlSource. When setting ControlSource, static text part needs to be enclosed in quote marks. The example you show is missing the opening quote mark. However, setting to a field that holds static text and field names will just be seen as a single string, which is what you are experiencing. I don't know any way to accomplish what you want - no way to 'escape' and evaluate as field name references. Just need to build report with necessary static content (labels) and textboxes bound to fields.

    – June7
    Mar 26 at 4:26











  • Thanks for the corrections.. I fixed for any future readers.

    – jeremyssmith
    Mar 26 at 4:54











  • What event did you even use to set textbox ControlSource? I think what you wanted would be even more complicated for users. Would they have to know to include [ ] characters appropriately in typed input?

    – June7
    Mar 26 at 5:26











  • My example above is way simplified.. I used a form that allows the user to type free text, and then from a combo box they choose the field to enter. Each time the combo changes (afterupdate) I run vb to fill the textbox. It actually works beautifully.. up until I can't use the data for anything.

    – jeremyssmith
    Mar 26 at 5:55











  • I figured a way I could do it.. it works, but it's not as clean as I'd like it to be. The user "builds" the template using the form I already created- and then when all the textboxes are filled (there are many dynamic portions of this report)- I can use vb to cycle through the textbox and break out each text field (by searching for the [ ]) and then change the controlsource of the textfield in the saved report. Then.. when I call the report (from another form) it would just be filling in the data like a normal report.

    – jeremyssmith
    Mar 26 at 6:00













0












0








0








I have an access table that I want to use to make a dynamic template for building a report. How do I use the values stored in that table in the report? As the programmer, I know how to manually write the code in the report...BUT...I want to store the information in a table instead of hard coding it, to give the USER the ability to modify the template of the report, long after I've gone.



Specifically:



  • Enter this in table: 1. The person of interest is [First] [Last]

  • I will use code to modify the user entered value as: "1. The person of interest is " & [First] & " " & [Last]

  • In the Report, I want the unbound textbox to pull the information stored in the table to change the ControlSource so that when the report runs you get the desired outcome: 1. The person of interest is John Doe

I have tried using MyText.ControlSource = [TemplateField], but all this does is makes the report show the contents of the text field. I'm guessing I need to escape the code in some way so that the report reads the items in "[ ]" as code vice text, but I can't figure out how to do that while storing it at the same time.










share|improve this question
















I have an access table that I want to use to make a dynamic template for building a report. How do I use the values stored in that table in the report? As the programmer, I know how to manually write the code in the report...BUT...I want to store the information in a table instead of hard coding it, to give the USER the ability to modify the template of the report, long after I've gone.



Specifically:



  • Enter this in table: 1. The person of interest is [First] [Last]

  • I will use code to modify the user entered value as: "1. The person of interest is " & [First] & " " & [Last]

  • In the Report, I want the unbound textbox to pull the information stored in the table to change the ControlSource so that when the report runs you get the desired outcome: 1. The person of interest is John Doe

I have tried using MyText.ControlSource = [TemplateField], but all this does is makes the report show the contents of the text field. I'm guessing I need to escape the code in some way so that the report reads the items in "[ ]" as code vice text, but I can't figure out how to do that while storing it at the same time.







vba ms-access report






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 26 at 5:54









June7

6,2945 gold badges13 silver badges27 bronze badges




6,2945 gold badges13 silver badges27 bronze badges










asked Mar 26 at 2:34









jeremyssmithjeremyssmith

61 bronze badge




61 bronze badge












  • Textbox does not have RecordSource, it has ControlSource. When setting ControlSource, static text part needs to be enclosed in quote marks. The example you show is missing the opening quote mark. However, setting to a field that holds static text and field names will just be seen as a single string, which is what you are experiencing. I don't know any way to accomplish what you want - no way to 'escape' and evaluate as field name references. Just need to build report with necessary static content (labels) and textboxes bound to fields.

    – June7
    Mar 26 at 4:26











  • Thanks for the corrections.. I fixed for any future readers.

    – jeremyssmith
    Mar 26 at 4:54











  • What event did you even use to set textbox ControlSource? I think what you wanted would be even more complicated for users. Would they have to know to include [ ] characters appropriately in typed input?

    – June7
    Mar 26 at 5:26











  • My example above is way simplified.. I used a form that allows the user to type free text, and then from a combo box they choose the field to enter. Each time the combo changes (afterupdate) I run vb to fill the textbox. It actually works beautifully.. up until I can't use the data for anything.

    – jeremyssmith
    Mar 26 at 5:55











  • I figured a way I could do it.. it works, but it's not as clean as I'd like it to be. The user "builds" the template using the form I already created- and then when all the textboxes are filled (there are many dynamic portions of this report)- I can use vb to cycle through the textbox and break out each text field (by searching for the [ ]) and then change the controlsource of the textfield in the saved report. Then.. when I call the report (from another form) it would just be filling in the data like a normal report.

    – jeremyssmith
    Mar 26 at 6:00

















  • Textbox does not have RecordSource, it has ControlSource. When setting ControlSource, static text part needs to be enclosed in quote marks. The example you show is missing the opening quote mark. However, setting to a field that holds static text and field names will just be seen as a single string, which is what you are experiencing. I don't know any way to accomplish what you want - no way to 'escape' and evaluate as field name references. Just need to build report with necessary static content (labels) and textboxes bound to fields.

    – June7
    Mar 26 at 4:26











  • Thanks for the corrections.. I fixed for any future readers.

    – jeremyssmith
    Mar 26 at 4:54











  • What event did you even use to set textbox ControlSource? I think what you wanted would be even more complicated for users. Would they have to know to include [ ] characters appropriately in typed input?

    – June7
    Mar 26 at 5:26











  • My example above is way simplified.. I used a form that allows the user to type free text, and then from a combo box they choose the field to enter. Each time the combo changes (afterupdate) I run vb to fill the textbox. It actually works beautifully.. up until I can't use the data for anything.

    – jeremyssmith
    Mar 26 at 5:55











  • I figured a way I could do it.. it works, but it's not as clean as I'd like it to be. The user "builds" the template using the form I already created- and then when all the textboxes are filled (there are many dynamic portions of this report)- I can use vb to cycle through the textbox and break out each text field (by searching for the [ ]) and then change the controlsource of the textfield in the saved report. Then.. when I call the report (from another form) it would just be filling in the data like a normal report.

    – jeremyssmith
    Mar 26 at 6:00
















Textbox does not have RecordSource, it has ControlSource. When setting ControlSource, static text part needs to be enclosed in quote marks. The example you show is missing the opening quote mark. However, setting to a field that holds static text and field names will just be seen as a single string, which is what you are experiencing. I don't know any way to accomplish what you want - no way to 'escape' and evaluate as field name references. Just need to build report with necessary static content (labels) and textboxes bound to fields.

– June7
Mar 26 at 4:26





Textbox does not have RecordSource, it has ControlSource. When setting ControlSource, static text part needs to be enclosed in quote marks. The example you show is missing the opening quote mark. However, setting to a field that holds static text and field names will just be seen as a single string, which is what you are experiencing. I don't know any way to accomplish what you want - no way to 'escape' and evaluate as field name references. Just need to build report with necessary static content (labels) and textboxes bound to fields.

– June7
Mar 26 at 4:26













Thanks for the corrections.. I fixed for any future readers.

– jeremyssmith
Mar 26 at 4:54





Thanks for the corrections.. I fixed for any future readers.

– jeremyssmith
Mar 26 at 4:54













What event did you even use to set textbox ControlSource? I think what you wanted would be even more complicated for users. Would they have to know to include [ ] characters appropriately in typed input?

– June7
Mar 26 at 5:26





What event did you even use to set textbox ControlSource? I think what you wanted would be even more complicated for users. Would they have to know to include [ ] characters appropriately in typed input?

– June7
Mar 26 at 5:26













My example above is way simplified.. I used a form that allows the user to type free text, and then from a combo box they choose the field to enter. Each time the combo changes (afterupdate) I run vb to fill the textbox. It actually works beautifully.. up until I can't use the data for anything.

– jeremyssmith
Mar 26 at 5:55





My example above is way simplified.. I used a form that allows the user to type free text, and then from a combo box they choose the field to enter. Each time the combo changes (afterupdate) I run vb to fill the textbox. It actually works beautifully.. up until I can't use the data for anything.

– jeremyssmith
Mar 26 at 5:55













I figured a way I could do it.. it works, but it's not as clean as I'd like it to be. The user "builds" the template using the form I already created- and then when all the textboxes are filled (there are many dynamic portions of this report)- I can use vb to cycle through the textbox and break out each text field (by searching for the [ ]) and then change the controlsource of the textfield in the saved report. Then.. when I call the report (from another form) it would just be filling in the data like a normal report.

– jeremyssmith
Mar 26 at 6:00





I figured a way I could do it.. it works, but it's not as clean as I'd like it to be. The user "builds" the template using the form I already created- and then when all the textboxes are filled (there are many dynamic portions of this report)- I can use vb to cycle through the textbox and break out each text field (by searching for the [ ]) and then change the controlsource of the textfield in the saved report. Then.. when I call the report (from another form) it would just be filling in the data like a normal report.

– jeremyssmith
Mar 26 at 6:00












0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55349045%2fcan-code-stored-in-a-table-be-used-to-dynamically-fill-an-unbound-textbox-in-an%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55349045%2fcan-code-stored-in-a-table-be-used-to-dynamically-fill-an-unbound-textbox-in-an%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript