TextBox After Update Output to Summary Box

Plukey

Board Regular
Joined
Apr 19, 2019
Messages
138
Office Version
  1. 2016
Platform
  1. Windows
On each Sub form there's a (Remarks) textbox that if user enters in a comment and after update, On a Master Form the (Summary) text box will output & say "See SB1. I need it to only update the one time. If user deletes or adds text each update it will continue to say See that.. section multiple times. Is there a way to limit it to once per After update?

Example:
Sub Form 1, Textbox9 (Remarks) & After Update Output to Master Form Textbox9 (Summary) SEE SB1,

Sub Form 2, Textbox9 (Remarks) & After Update Output to Master Form Textbox9 (Summary) SEE SB2,



This code is placed on each Sub Form's (Remark's) Text box that's Named Textbox 9 After Update...

The Master Form (Summary) Textbox is also Named Textbox9....I know, Not sure why the creator did that.

VBA Code:
Private Sub Text9_AfterUpdate()
    Dim Output As String
   
    Output = Text9
    Text9 = Output
    Forms![Data Entry Form]![Master Tab Subform]!Text9 = Forms![Data Entry Form]![Master Tab Subform]!Text9 & vbCrL & "SEE SB1, "
   
End Sub
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
On each Sub form there's a (Remarks) textbox that if user enters in a comment and after update, On a Master Form the (Summary) text box will output & say "See SB1. I need it to only update the one time. If user deletes or adds text each update it will continue to say See that.. section multiple times. Is there a way to limit it to once per After update?

Example:
Sub Form 1, Textbox9 (Remarks) & After Update Output to Master Form Textbox9 (Summary) SEE SB1,

Sub Form 2, Textbox9 (Remarks) & After Update Output to Master Form Textbox9 (Summary) SEE SB2,



This code is placed on each Sub Form's (Remark's) Text box that's Named Textbox 9 After Update...

The Master Form (Summary) Textbox is also Named Textbox9....I know, Not sure why the creator did that.

VBA Code:
Private Sub Text9_AfterUpdate()
    Dim Output As String
  
    Output = Text9
    Text9 = Output
    Forms![Data Entry Form]![Master Tab Subform]!Text9 = Forms![Data Entry Form]![Master Tab Subform]!Text9 & vbCrL & "SEE SB1, "
  
End Sub
The way the code is currently written it is concatenating "SEE SB1," with the current contents of the MasterTabSubform.Text9.

The question is when do you want SB1 or SB2 to be written to MasterTabSubform, and when shouldn't it?


On Sub Form 1 you could add a global (to form variable) like
private dim TB9Comment as Boolean

In the Sub Form 1.Activate event set
TB9Comment = false

Change the Sub Form 1.AfterUpdate code to:
Note: the first three lines of code do not seem to be necessary, they do not do anything.
VBA Code:
Private Sub Text9_AfterUpdate()
    Dim Output As String
  
    Output = Text9
    Text9 = Output
    If Not TB9Comment then
        Forms![Data Entry Form]![Master Tab Subform]!Text9 = Forms![Data Entry Form]![Master Tab Subform]!Text9 & vbCrL & "SEE SB1, "
        TB9Comment = true
    End If
End Sub
 
Upvote 0
The way the code is currently written it is concatenating "SEE SB1," with the current contents of the MasterTabSubform.Text9.

The question is when do you want SB1 or SB2 to be written to MasterTabSubform, and when shouldn't it?


On Sub Form 1 you could add a global (to form variable) like
private dim TB9Comment as Boolean

In the Sub Form 1.Activate event set
TB9Comment = false

Change the Sub Form 1.AfterUpdate code to:
Note: the first three lines of code do not seem to be necessary, they do not do anything.
VBA Code:
Private Sub Text9_AfterUpdate()
    Dim Output As String
 
    Output = Text9
    Text9 = Output
    If Not TB9Comment then
        Forms![Data Entry Form]![Master Tab Subform]!Text9 = Forms![Data Entry Form]![Master Tab Subform]!Text9 & vbCrL & "SEE SB1, "
        TB9Comment = true
    End If
End Sub
I'll give that a go...

(The question is when do you want SB1 or SB2 to be written to MasterTabSubform, and when shouldn't it?) The Sub Forms are basically audits and if we find a problem we write a small statement in the remarks Text box. They only want SB1 or SB2 to show up in the Master Form (Summary) Text box is if we write a statement in one of the Sub forms remarks text box.

****As I was writing this reply I was just told now they want just a simple "YES" If any of the Sub Forms Remarks Textbox has a statement.. HAHAH its always changing!****
 
Upvote 0
So
If I made a comment on Sub Form 1, then made a comment on Sub Form2, the came back to Sub Form 1 and made another comment would you want to See “SB1” (or “YES” once or twice? What if the Excel Workbook is closed then opened again.

Hence, the question what should trigger writing to the Master Sub Form?
 
Upvote 0
So
If I made a comment on Sub Form 1, then made a comment on Sub Form2, the came back to Sub Form 1 and made another comment would you want to See “SB1” (or “YES” once or twice? What if the Excel Workbook is closed then opened again.

Hence, the question what should trigger writing to the Master Sub Form?
At the moment, if either of the Sub Forms SB1 or SB2 receive a remark's comment. That is when the Master Form Summary textbox should be triggered now with a "Yes" that will let the reviewer know that there is a issue. FYI... this is a Access Data Base not a Excel Workbook.
 
Upvote 0
I would add some sort of flag on each record.
When updating textbox9 (absolutely stupid name BTW :( ) for the first time, update it to indicate the update has occurred.
Then prevent any more updates if that flag is set.
 
Upvote 0
this is a Access Data Base not a Excel Workbook
Bosquedeguate,
You want to be aware of what forum you are in when answering questions. My guess is that you found this question in the "Unanswered threads" listing.
Note that it shows you which forum each question is in:

1691428675899.png
 
Upvote 0
I would add some sort of flag on each record.
When updating textbox9 (absolutely stupid name BTW :( ) for the first time, update it to indicate the update has occurred.
Then prevent any more updates if that flag is set.
Totally agree with not identifying the Textboxes! I've made that comment as well. I appreciate the feed back!
 
Upvote 0

Forum statistics

Threads
1,215,093
Messages
6,123,068
Members
449,091
Latest member
remmuS24

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top