Populate a Memo field using a pop-up box

L

lsgKelly

I have a memo field on a form that I would like my users to be able to
populate using a pop-up box. They would click on a button, a pop-up would
show with the date/time and username, then after they fill out the
information, it would populate in a memo box on the form. The memo-box would
not be updateable by the user.

Is this possible?

The memo field is called gNotes and is used to keep a history on the record.

Thanks in advance,

Kelly
 
G

GBA

well there is a pop-up 'form'.... if that is what you mean by pop up
box...not sure

and yes; sure you could have the data in that form get written to the memo
field...but I think the question is raised as to why use the pop-up??? why
not just write to the memo field itself in the first place....

not sure of the human experience you are attempting to create - but at some
appropriate event you can move the data from the pop up to the memo field...

me.gNotes = Forms!PopUpForm.PopUpTextField
 
A

Arvin Meyer MVP

This should work:

Private Sub cmdZoomBox_Click()
Me.txtMyMemo.SetFocus
Me.txtMyMemo = Me.txtMyMemo & vbCrLf & vbCrLf & Now() & " - " &
CurrentUser() & vbCrLf
Me.txtMyMemo.Locked = False
DoCmd.RunCommand acCmdZoomBox
DoCmd.RunCommand acCmdSaveRecord
Me.txtMyMemo.Locked = True
End Sub

Now, the CurrentUser() function will only return a username if Access User
Level Security is enabled. If you can't or haven't done that, try using the
Windows Username funtion from:

http://www.mvps.org/access/api/api0008.htm
 
D

David W. Fenton

Private Sub cmdZoomBox_Click()
Me.txtMyMemo.SetFocus
Me.txtMyMemo = Me.txtMyMemo & vbCrLf & vbCrLf & Now() & " - "
&
CurrentUser() & vbCrLf
Me.txtMyMemo.Locked = False
DoCmd.RunCommand acCmdZoomBox
DoCmd.RunCommand acCmdSaveRecord
Me.txtMyMemo.Locked = True
End Sub

Better still:

Public Function ZoomBox(strObjName As String, _
strCtlName As String, strCurrValue As String, _
Optional strFontName As String, _
Optional intFontWeight As Integer, _
Optional intFontSize As Integer) As Variant
ZoomBox = Application.Run("UTILITY.BuilderZoom", strObjName, _
strCtlName, strCurrValue, strFontName, intFontWeight,
intFontSize)
End Function

Then call it thus:

Private Sub cmdZoomBox_Click()
Me!txtMyMemo.Locked = False
Me!txtMyMemo = ZoomBox(Me.Name, "txtMyMemo", Me!txtMyMemo)
Me.Dirty = False
Me!txtMyMemo.Locked = True
Then Exit Sub

It's just using the built-in wizard directly, instead of invoking it
with a RunCommand, which necessitates setting focus and so forth.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top