Now, in this example, there are two memo fields, but only one is bound, since the other memo field is simply a temporary holding area.
NotesMemoField is unbound, and in the Property Box its
Visible Property is set originally set to to
No. I place mine side by side with the
CommentsMemoField so the user can refer to what's currently in the Comments section while entering new notes.
CommentsMemoField is bound to the underlying table/query, and its
Locked Property is set to
Yes.
Place a command button on the form. Name it
InputData and in the Properties Box set its
Caption to
Input.
Now use this code:
-
Private Sub InputData_Click()
-
If InputData.Caption = "Input" Then
-
NotesMemoField.Visible = True
-
NotesMemoField.SetFocus
-
InputData.Caption = "Add Data"
-
Else
-
InputData.Caption = "Input"
-
If IsNull(Me.CommentsMemoField) Then
-
If Len(Me.NotesMemoField) > 0 Then
-
Me.CommentsMemoField = Me.CommentsMemoField & Me.NotesMemoField
-
Me.NotesMemoField = ""
-
NotesMemoField.Visible = False
-
Else
-
NotesMemoField.Visible = False
-
End If
-
Else
-
If Len(Me.NotesMemoField) > 0 Then
-
Me.CommentsMemoField = Me.CommentsMemoField & vbNewLine & Me.NotesMemoField
-
Me.NotesMemoField = ""
-
NotesMemoField.Visible = False
-
Else
-
NotesMemoField.Visible = False
-
End If
-
-
End If
-
End If
-
End Sub
Anytime you copy and paste this much code from Access to a post things can go awry; let me know if you have any problems.
Linq
;0)>