Solved

String Change

Posted on 1999-01-11
4
178 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
DO Loop not working 4 72
Write data from SQL to CSV file - position 1 53
Windows 10 start screen issues 9 52
Adding to a VBA? 6 63
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

863 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

16 Experts available now in Live!

Get 1:1 Help Now