Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-26-2021, 06:24 AM
JamesWood JamesWood is offline UserForm auto refresh/update Windows 10 UserForm auto refresh/update Office 2019
Advanced Beginner
UserForm auto refresh/update
 
Join Date: Nov 2020
Posts: 37
JamesWood is on a distinguished road
Question UserForm auto refresh/update

Hi guys


I'm designing a UserForm which has two TextBoxes. I'm wondering if the second textbox can reflect the changes made to the first text box, in real time?


See the attached image.


So the first userform is DateBox, and second is FileNamePreview. The DateBox userform defaults to showing today's date, but if the user then decides to alter that date, I want it to reflect automatically in the FileNamePreview form.


With Me.DateBox
.Value = Format((Year(Now() + 1) Mod 100), "20##") & Format((Month(Now() + 1) Mod 100), "0#") & Format((Day(Now()) Mod 100), "0#")
End With




With Me.FileNamePreview
.Value = LetterTo & docNameFieldPreview & " " & Me.DateBox.Value
End With


Thanks a lot
James
Attached Images
File Type: png UserForm refresh.png (4.5 KB, 15 views)
Reply With Quote
  #2  
Old 05-26-2021, 05:28 PM
Guessed's Avatar
Guessed Guessed is offline UserForm auto refresh/update Windows 10 UserForm auto refresh/update Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,969
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

The OnChange event does this
Code:
Private Sub DateBox_Change()
  Me.FileNamePreview.Value = "Letter to " & Me.DateBox
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 05-27-2021, 12:11 AM
JamesWood JamesWood is offline UserForm auto refresh/update Windows 10 UserForm auto refresh/update Office 2019
Advanced Beginner
UserForm auto refresh/update
 
Join Date: Nov 2020
Posts: 37
JamesWood is on a distinguished road
Default

Quote:
Originally Posted by Guessed View Post
The OnChange event does this
Code:
Private Sub DateBox_Change()
  Me.FileNamePreview.Value = "Letter to " & Me.DateBox
End Sub


That's amazing, thank you so much!
Reply With Quote
Reply

Tags
refresh, update, userform



Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto-refresh pivot table without losing undo buffer Peterson Excel Programming 0 03-25-2020 06:56 PM
Can't update/refresh embedded Excel file with Power Point 2010 command button mt1013 PowerPoint 0 06-17-2015 05:18 AM
Update Bookmarks from a Userform alshcover Word VBA 12 01-12-2015 06:53 PM
UserForm auto refresh/update Auto Refresh Pivot Table on Timer bremen22 Excel 2 10-01-2013 01:00 AM
VBA code to update record in Access 2003 using Userform in Excel primmer3001 Excel Programming 0 08-29-2011 04:25 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:39 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