Update the default value of a form text control.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a control on a form named
[Forms]![frmPrintClaimMaint]![strHeadingText]. The control is used to print
text in a report header. Users can print reports using the control's default
text, or modify the text for their specific needs. The form is used
sporadically, so the default text becomes dated after a while. Therefore, I
want to allow users to change the control's default text.

I was thinking a simple macro attached to a button ought to do the trick. My
conceptual approach was to allow the user to type in new text, either in
strHeadingText or in another control such as strTempText. The macro would use
a sequence something like:

SetValue
Item: [Forms]![frmPrintClaimMaint]![strHeadingText].[DefaultValue]
Expression: [Forms]![frmPrintClaimMaint]![strTempText]

Save
Object Type: Form
Object Name: frmPrintClaimMaint

RepaintObject
Object Type: Form
Object Name: frmPrintClaimMaint

This approach fails to update the default value. Any thoughts? Is a macro a
usable approach, or should I go to VB? Whichever approach, I cannot seem to
discover my error.
 
Hello "Coxrail2".

Coxrail2 said:
I have a control on a form named
[Forms]![frmPrintClaimMaint]![strHeadingText]. The control is used
to print text in a report header. Users can print reports using the
control's default text, or modify the text for their specific needs.
The form is used sporadically, so the default text becomes dated
after a while. Therefore, I want to allow users to change the
control's default text.

I was thinking a simple macro attached to a button ought to do the
trick. My conceptual approach was to allow the user to type in new
text, either in strHeadingText or in another control such as
strTempText. The macro would use a sequence something like:

SetValue
Item: [Forms]![frmPrintClaimMaint]![strHeadingText].[DefaultValue]
Expression: [Forms]![frmPrintClaimMaint]![strTempText]

Save
Object Type: Form
Object Name: frmPrintClaimMaint

RepaintObject
Object Type: Form
Object Name: frmPrintClaimMaint

To permanently change the default value of the textbox, you will
have to open the form in design view (which can be hidden) from
womewhere outside the form, change the default value and then
close and save the form.
But I think that this would not be a good approach, because this
would mean changing the design while users work with the form.
It might be a better approach to store the new default value in a
table and read that value and set the default value in the open
event of the form. This way, each user could have an other value.
 
This helps. Thanks.
--
TCox


Wolfgang Kais said:
Hello "Coxrail2".

Coxrail2 said:
I have a control on a form named
[Forms]![frmPrintClaimMaint]![strHeadingText]. The control is used
to print text in a report header. Users can print reports using the
control's default text, or modify the text for their specific needs.
The form is used sporadically, so the default text becomes dated
after a while. Therefore, I want to allow users to change the
control's default text.

I was thinking a simple macro attached to a button ought to do the
trick. My conceptual approach was to allow the user to type in new
text, either in strHeadingText or in another control such as
strTempText. The macro would use a sequence something like:

SetValue
Item: [Forms]![frmPrintClaimMaint]![strHeadingText].[DefaultValue]
Expression: [Forms]![frmPrintClaimMaint]![strTempText]

Save
Object Type: Form
Object Name: frmPrintClaimMaint

RepaintObject
Object Type: Form
Object Name: frmPrintClaimMaint

To permanently change the default value of the textbox, you will
have to open the form in design view (which can be hidden) from
womewhere outside the form, change the default value and then
close and save the form.
But I think that this would not be a good approach, because this
would mean changing the design while users work with the form.
It might be a better approach to store the new default value in a
table and read that value and set the default value in the open
event of the form. This way, each user could have an other value.
 
This helped. Thanks.
--
TCox


Wolfgang Kais said:
Hello "Coxrail2".

Coxrail2 said:
I have a control on a form named
[Forms]![frmPrintClaimMaint]![strHeadingText]. The control is used
to print text in a report header. Users can print reports using the
control's default text, or modify the text for their specific needs.
The form is used sporadically, so the default text becomes dated
after a while. Therefore, I want to allow users to change the
control's default text.

I was thinking a simple macro attached to a button ought to do the
trick. My conceptual approach was to allow the user to type in new
text, either in strHeadingText or in another control such as
strTempText. The macro would use a sequence something like:

SetValue
Item: [Forms]![frmPrintClaimMaint]![strHeadingText].[DefaultValue]
Expression: [Forms]![frmPrintClaimMaint]![strTempText]

Save
Object Type: Form
Object Name: frmPrintClaimMaint

RepaintObject
Object Type: Form
Object Name: frmPrintClaimMaint

To permanently change the default value of the textbox, you will
have to open the form in design view (which can be hidden) from
womewhere outside the form, change the default value and then
close and save the form.
But I think that this would not be a good approach, because this
would mean changing the design while users work with the form.
It might be a better approach to store the new default value in a
table and read that value and set the default value in the open
event of the form. This way, each user could have an other value.
 
Back
Top