Many ways, but here is one. On the Dirty property of the subform:
[myTextBox] =IIf(Forms!frmContracts!RFQType='R',"NGSS Material
Replacements","NGSS COSAL
Material Replacements")
Or you can place it in the AfterUpdate event of a control on the subform.
[myTextBox] is the Textbox on the subform you wish to populate. If you want
to populate [txtProgramName] then you need to clear the ControlSource
property of the textbox.
God Bless,
Mark A. Sam
>I have a subform that has a text box "txtProgramName" that has
> "=IIf(Forms!frmContracts!RFQType='R',"NGSS Material Replacements","NGSS
[quoted text clipped - 4 lines]
>
> How is this done?
Nanette - 15 Mar 2007 16:11 GMT
Hi Mark,
Thanks for answering. Apparently I didn't explain myself very well. I
already have the code " [myTextBox] =IIf(Forms!frmContracts!RFQType='R',"NGSS
Material
Replacements","NGSS COSAL Material Replacements") in my form.
What is not happening is the data is not being put into the source table.
So, although I see "NGSS Material Replacements" in the text box on the form,
the data is not being put into the underlying table. I thought it did this
automatically, but it isn't happening.
Any other suggestions?
> Many ways, but here is one. On the Dirty property of the subform:
>
[quoted text clipped - 19 lines]
> >
> > How is this done?
Mark A. Sam - 15 Mar 2007 17:29 GMT
Hello Nanette,
Is it your understanding that setting the ControlSource value of a textbox
to "= WhateverValue" will place data into a table? It won't. The purpose
is to display a value in a textbox for the user's information. If you want
to place the data into a table, you should use Code to place it into the
table by populated a control on a form, like in the example I gave or
through DAO, which are methods for addressing tables.
> Hi Mark,
>
[quoted text clipped - 36 lines]
>> >
>> > How is this done?
Nanette - 15 Mar 2007 18:42 GMT
Hi Mark,
Guess I didn't understand your first message. I tried putting the code
"[txtProgramName] =IIf(Forms!frmContracts!RFQType='R',"NGSS Material
Replacements","NGSS COSAL Material Replacements")" into the Dirty option on
the SubForm, made sure the ControlSource was empty, and now I'm getting the
message that the Macro can't be found.
I've only been working full time in Access databases for 6 months now and am
wondering if I should try something different. I just don't seem to
understand some things :-((
> Hello Nanette,
>
[quoted text clipped - 45 lines]
> >> >
> >> > How is this done?