Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display Date In an Input Box

Status
Not open for further replies.

Computer8822

Programmer
Aug 7, 2008
20
Hello,

I have a casl macro program that will ask for several options through popup input boxes. One of them asks for the date. I was wondering if there was a way to diplay the date within this popup box so the user will pretty much just have to hit enter? The date will display as mmddyyyy.
 
If you're using Attachmate's Macro Editor then it should be fairly simple.

Code:
Begin Dialog newdlg 125, 5, 185, 90
        
OkButton  130, 5, 50, 15
CancelButton  130, 25, 50, 15
        
Text  20, 15, 70, 15, date
        
End Dialog
This is just a simple dialog box that displays the date but the important part of the code is text line. Hope that helps.
 
You can also use the InputBox function as shown below
Code:
Dim sDate as string
sDate = InputBox("Enter the date you want:", "Any Caption", Format(Date, "mmddyyyy"))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top