P
pricey99
I was advised a few days ago to rewrite various bits of code that used
SendKeys as that function has become v temperatmental. I have replaced
almost everything but there is one seemingly simple application that I just
can't replicate.
I have a series of memo fields where users add their own comments about a
particular record. If they press a datestamp button, the SendKeys based code
will add the date and their name to the top of the memo field and the
insertion point will then be in exactly the right position for them to type
their comment. The SendKeys based code I've been using is below.
Without SendKeys, I've been able to add the datestamp information to the top
of the memo field - but I cannot find a way to then move the insertion point
to the correct place within the memo field - just below the datestamp info.
Any ideas?
Thanks
Public Function DateStamp(StampControlName As Variant) As Integer
DoCmd.GoToControl StampControlName
SendKeys "{F2}^{Home}^{Enter}^{Enter}^{Home}" & Format$(Now, "dddd mmmm d,
yyyy hh:nn AM/PM") & " - " & Forms!settings!user.Column(1) & "^{Enter}"
End Function
SendKeys as that function has become v temperatmental. I have replaced
almost everything but there is one seemingly simple application that I just
can't replicate.
I have a series of memo fields where users add their own comments about a
particular record. If they press a datestamp button, the SendKeys based code
will add the date and their name to the top of the memo field and the
insertion point will then be in exactly the right position for them to type
their comment. The SendKeys based code I've been using is below.
Without SendKeys, I've been able to add the datestamp information to the top
of the memo field - but I cannot find a way to then move the insertion point
to the correct place within the memo field - just below the datestamp info.
Any ideas?
Thanks
Public Function DateStamp(StampControlName As Variant) As Integer
DoCmd.GoToControl StampControlName
SendKeys "{F2}^{Home}^{Enter}^{Enter}^{Home}" & Format$(Now, "dddd mmmm d,
yyyy hh:nn AM/PM") & " - " & Forms!settings!user.Column(1) & "^{Enter}"
End Function