Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-02-2014, 01:39 PM
donnac1107 donnac1107 is offline Creating an "Approved" command button Windows 7 32bit Creating an "Approved" command button Office 2010 32bit
Novice
Creating an "Approved" command button
 
Join Date: Sep 2014
Posts: 6
donnac1107 is on a distinguished road
Smile Creating an "Approved" command button

Hi,



Would anyone be able to help me create a command button, where a user will click on and it will capture their windows login ID, date and time. It will display this information on the next line below the command button.

I will appreciate any suggestions, I am at a complete lost.

Thanks for your help.
Reply With Quote
  #2  
Old 09-02-2014, 03:39 PM
macropod's Avatar
macropod macropod is offline Creating an "Approved" command button Windows 7 64bit Creating an "Approved" command button Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

What happens if the button is clicked more than once - including by different people?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 09-02-2014, 05:22 PM
donnac1107 donnac1107 is offline Creating an "Approved" command button Windows 7 32bit Creating an "Approved" command button Office 2010 32bit
Novice
Creating an "Approved" command button
 
Join Date: Sep 2014
Posts: 6
donnac1107 is on a distinguished road
Default Re: Creating an "Approved" command button

Ideally once the button is clicked, the form will be locked so no more changes can be made. Thanks.
Reply With Quote
  #4  
Old 09-02-2014, 06:05 PM
macropod's Avatar
macropod macropod is offline Creating an "Approved" command button Windows 7 64bit Creating an "Approved" command button Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

What kinds of controls, if any, does this form already use (i.e. formfields or content controls)?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 09-02-2014, 06:30 PM
donnac1107 donnac1107 is offline Creating an "Approved" command button Windows 7 32bit Creating an "Approved" command button Office 2010 32bit
Novice
Creating an "Approved" command button
 
Join Date: Sep 2014
Posts: 6
donnac1107 is on a distinguished road
Default

It is a form with form fields, what I am trying to achieve is, have the person complete the form, send it to their manager. The manager will review the form, click a button to approve the form. I was thinking if maybe word can capture their windows login as a signature. Then once form will be protected and no further changes can be made.

Thanks.
Reply With Quote
  #6  
Old 09-02-2014, 07:48 PM
macropod's Avatar
macropod macropod is offline Creating an "Approved" command button Windows 7 64bit Creating an "Approved" command button Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

If you're using formfields, the document will already require Forms protection. In that case, you could use another text formfield for both the 'button' and the approval text.

For example, if you insert such a formfield and make its default text:
Click Here to Approve
you could attach an on-entry macro to it, coded as follows:
Code:
Sub Approval()
With ActiveDocument.FormFields("Text1")
  .Result = "Approved by " & Environ("Username") & " on " & Format(Now(), "DDDD, D MMMM YYYY @ hh:mm")
  .Enabled = False
End With
End Sub
where the formfield's internal bookmark name is 'Text1'.

Do note that, as coded, only the approval formfield is locked.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 09-03-2014, 07:44 AM
donnac1107 donnac1107 is offline Creating an "Approved" command button Windows 7 32bit Creating an "Approved" command button Office 2010 32bit
Novice
Creating an "Approved" command button
 
Join Date: Sep 2014
Posts: 6
donnac1107 is on a distinguished road
Default Thank you

Thank you very much for your help. This is exactly what I am looking for. I am not very good with Macros but I will try and figure it out.

Thanks again!!
Reply With Quote
  #8  
Old 09-03-2014, 02:53 PM
macropod's Avatar
macropod macropod is offline Creating an "Approved" command button Windows 7 64bit Creating an "Approved" command button Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

For PC macro installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #9  
Old 09-04-2014, 11:05 AM
donnac1107 donnac1107 is offline Creating an "Approved" command button Windows 7 32bit Creating an "Approved" command button Office 2010 32bit
Novice
Creating an "Approved" command button
 
Join Date: Sep 2014
Posts: 6
donnac1107 is on a distinguished road
Thumbs up Thank you!!

Here is the code I used. I created a command button and used the code you recommended and it works beautifully. Thank you so much

Private Sub CommandButton1_Click()
With ActiveDocument.FormFields("Text124")
.Result = "Entered by " & Environ("Username") & " on " & Format(Now(), "DDDD, D MMMM YYYY @ hh:mm")
.Enabled = False
End With

End Sub
Reply With Quote
  #10  
Old 09-04-2014, 03:04 PM
macropod's Avatar
macropod macropod is offline Creating an "Approved" command button Windows 7 64bit Creating an "Approved" command button Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Donna,

While that certainly works the way you originally described, the approach I suggested obviates the need for a separate button. With my approach, the formfield becomes its own 'button'.

Also be aware that ActiveX controls (the kind of control you used for the button) aren't supported on Macs, so your approach won't work if anyone with a Mac needs to use the form.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #11  
Old 09-04-2014, 07:45 PM
donnac1107 donnac1107 is offline Creating an "Approved" command button Windows 7 32bit Creating an "Approved" command button Office 2010 32bit
Novice
Creating an "Approved" command button
 
Join Date: Sep 2014
Posts: 6
donnac1107 is on a distinguished road
Smile

Thanks Chris,

Your suggestion does make a cleaner nicer looking form, but I was having trouble getting it to work with just the form field. All our users are on Windows, so we should not run into the issue for Mac users.

Thanks again for your suggestion.

Donna
Reply With Quote
Reply

Tags
approval, command button



Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating an "Approved" command button Having trouble with "Same as Previous" button for formatting headers Roy Patience Word 3 05-24-2014 03:17 PM
"Problem sending the command" on only one .xlsm file, Office XP/Win 7 64bit skeith5 Excel 0 01-24-2012 02:24 PM
Creating an "Approved" command button Launch macro sub after hitting "create pdf" button in word webharvest Word VBA 1 06-29-2011 04:56 PM
"Back" Button - to behave like web browser (Not using last slide viewed). emmiewoo PowerPoint 0 03-29-2011 06:54 AM
"Send and Receive all Folders" button missing (but only with one account) incognitus Outlook 0 10-12-2010 10:42 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:01 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft