Insert Variable into form field

jneirinckx

Registered User.
Local time
Today, 07:32
Joined
Feb 28, 2004
Messages
133
Good morning,

Through code I create a string variable called strDoc and want to pass the value of that variable to the field in my form.

I would have thought it was a simple as:
Forms.frmContributionReceipts.SentLetters = strDoc
but I am getting a blank value.
1. How can I determine the value of the variable in the VB window

2. Am I passing the variable to the field incorrectly.

Thank You

Jerry
 
Try Me.sentLetters = strDoc from within the VBA code of the form. You may be overspecifying/misspecifying the form.

If that doesn't work, insert a breakpoint (click the left edge of the VBA screen until a green dot appears) in the Function/Event that is supposed to be inserting this code. Then hover your variables until you see an error. Failing that, go to the debug window while in codebreak and put in ? strDoc and ? Me.sentLetters just for giggles. F8 will step you through the rest of your function.
 
Code:
Forms.frmContributionReceipts.SentLetters = strDoc
IF THIS IS AN EXTERNAL i mean different and you pass values from a variable in public code or another form it's preferred to use this ".form" adding it before the control' s name...
Code:
Forms.frmContributionReceipts.Form.SentLetters = strDoc
 

Users who are viewing this thread

Back
Top Bottom