How to keep a memo displayed

Hello,

I have code that will write to my Memo box if there is a value in BC1 and so on.  It will only display the text if I in a record that has BC1.  I need to keep displaying after I click off the record so the user know that they entered something into the memo box

Here is my code
Private Sub Remarks1_AfterUpdate()
 Dim rst As DAO.Recordset
   Dim strRemarks As String
   
    strRemarks = Me.Remarks1
    If strRemarks = "" Then Exit Sub
   
   Set rst = CurrentDb.OpenRecordset("Final_Table")
   'strRemarks = Me.Remarks1

   Do While Not rst.EOF
      rst.Edit
        If Nz(rst![BC1Chng1]) <> "" Then
         rst![Remarks1] = strRemarks
      Else
         rst![Remarks1] = Null
      End If
      rst.Update
      rst.MoveNext
   Loop
      

End Sub

Open in new window

Jass SainiAsked:
Who is Participating?
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
I need to keep displaying after I click off the record
Keep displaying what?

You can always store the stuff you want to display in a form-level variable, and then show that variable wherever needed.

'/ In the General Declarations section of your form, at the top
Private MyText As String

'/ Somewhere else in your code, perhaps in the AfterUpdate event of a Textbox:
MyText = Me.YourTextBox

'/ Now show it somewhere:
Msgbox "The value in the variable is " & MyText
0
 
Jass SainiAuthor Commented:
On my form...if I click off the record the Remarks1 field doesn't show what I just typed.  I want it to continue to show even after I click off the record

MyText ..is a variable???
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
if I click off the record the Remarks1 field doesn't show what I just typed.
I assume the Remarks field is a bound textbox (that is, the textbox has a ControlSource)? If so, then it would show the value from the Remarks field for each RECORD.

If you "show" the value you type in one field in the others, then Access will update the other records. Is that what you're after?

Regardless, the method I suggested would work, assuming you always want to have the "latest" data typed into Remarks.

Yes, "MyText" is a variable, created in the General Declarations section of your form.
0
 
Jass SainiAuthor Commented:
Thank You
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.