Dates and Memo fields

M

Marcus G.

Hi all, thanks for looking.

I need to have a button that will enter the current date in a memo field.

I need to be allowed to enter the date (by clicking on this button) anywhere
within the text contained in the memo field.

Any ideas? Thanks,

Marcus
 
R

Rick Brandt

Marcus G. said:
Hi all, thanks for looking.

I need to have a button that will enter the current date in a memo field.

I need to be allowed to enter the date (by clicking on this button) anywhere
within the text contained in the memo field.

The problem is when you click on the button you will no longer be in the memo
field. It might be easier to click on a label or use a pop-up menu so that the
control doesn't lose focus. The SelStart and SelLength properties can be used
to determine where the cursor is so the date can be inserted there.
 
J

John Vinson

I need to have a button that will enter the current date in a memo field.

Ctrl-semicolon will do this. You could do some VBA code to do it as
well, but I'm not certain how you would retain the memory of where the
cursor is when you change focus to a command button!
 
M

Marcus G.

Thanks for the advice.

I simply created a macro with the sendkeys statement as ctrl; and added it
to my shortcut menu - works great!

Thanks again, Marcus G.
 

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