Solved

Copy formatted date/time value to a 2nd form

Posted on 2014-04-21
5
289 Views
Last Modified: 2014-04-22
I have a form which an expert helped me with to format a date/time field as:

SELECT tblLaborTranx.LaborTranxID, tblEmployees.FullName, Format(tblLaborTranx.StartTime,"m/d/yyyy h:nn") AS formattedStartTime, Format([tblLaborTranx].[StopTime],"m/d/yyyy h:nn") AS formattedStopTime
FROM tblLaborTranx LEFT JOIN tblEmployees ON tblLaborTranx.EmployeeID = tblEmployees.EmployeeID
ORDER BY tblEmployees.FullName;

This is working fine.  The date/time now looks like (for example):

4/18/2014 8:28 AM  (with no seconds showing)


But now on the form that this is displaying correctly on I have a command button that when clicked opens a second form.  On this 2nd for is a date/time field that I want to have display the value exactly as I see it from the 1st form.  I have tried this but it doesn't work:

    DoCmd.OpenForm "frmEDITEmployeeLaborTranx", , , "[LaborTranxID]=" & Me.txtRecordID
   
    Forms!frmEDITEmployeeLaborTranx.txtStartTime = Me.txtStart

  I'm getting this instead:

4/18/2014 8:28:03 AM  (with the seconds displaying.  How can I get rid of them?  The field is an unbound field.
0
Comment
Question by:SteveL13
  • 2
  • 2
5 Comments
 
LVL 6

Expert Comment

by:Dulton
ID: 40013121
try this:

  DoCmd.OpenForm "frmEDITEmployeeLaborTranx", , , "[LaborTranxID]=" & Me.txtRecordID
   
    Forms!frmEDITEmployeeLaborTranx.txtStartTime = Format(Me.txtStart,"m/d/yyyy h:nn")
0
 

Author Comment

by:SteveL13
ID: 40013211
That didn't do it.  txtStartTime shows the seconds which I don't want to display.
0
 
LVL 49

Accepted Solution

by:
Gustav Brock earned 500 total points
ID: 40014114
Change the Format property for that unbound textbox to either Standard or: m/d/yyyy h:nn

/gustav
0
 

Author Closing Comment

by:SteveL13
ID: 40014652
This did it.  Thanks.

m/d/yyyy h:nn
0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 40014670
You are welcome!

/gustav
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

813 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

12 Experts available now in Live!

Get 1:1 Help Now