Solved

Copy formatted date/time value to a 2nd form

Posted on 2014-04-21
5
291 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 50

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 50

Expert Comment

by:Gustav Brock
ID: 40014670
You are welcome!

/gustav
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

751 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