Solved

String Change

Posted on 1999-01-11
4
177 Views
Last Modified: 2010-05-03
I am looking for a short way to change a string and display it in label2.caption. All i want to do is label1.caption has the current date and Time and I want label2.caption to be  to look like "mm/dd/yyyy" Only PLUS 1 day.   With out using the datediff statement. my end result would look somthing like this

label1.caption "01/12/1999 01:02:03" and label2.capption "01/13/1999"  



Private Sub Form_Load()

Dim StsStr
SysStr = Format((Now), "mm/dd/yyyy" & " " & "hh:mm:ss")
    Label1.Caption = SysStr
    Label2.Caption =
0
Comment
Question by:raider187
4 Comments
 
LVL 3

Accepted Solution

by:
traygreen earned 50 total points
ID: 1455604
Use the DateAdd function
label2.caption = format(DateAdd("d", 1,label1.caption), "mm/dd/yyyy")
0
 
LVL 1

Expert Comment

by:tommy_boy
ID: 1455605
Private Sub Form_Load()

Dim StsStr
SysStr = Format((Now), "mm/dd/yyyy" & " " & "hh:mm:ss")
Label1.Caption = SysStr
Label1.refresh
Label2.Caption = CDate(Label1.caption) + 1




0
 
LVL 7

Expert Comment

by:Inteqam
ID: 1455606
tommyboy code works well

0
 
LVL 1

Author Comment

by:raider187
ID: 1455607
Execelent, it worked perfect, Thank you very much ....Raider
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now