Results 1 to 3 of 3
  1. #1
    George is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Feb 2012
    Posts
    295

    Control not reflecting the selected format

    I have an unbounded control "Schedule Arrival" on my form. The row source type is Table/Query and the row source is a table field "StaffStartTime" with datatype Date/Time medium time.

    This field contain the following values "8:00 AM" and "11:00 AM".



    When a button on the form is press for the value in the control to be displayed, irrespective of which value is selected in the control it always show 12:00 AM.

    This means it is not recognizing the entries.

    Is there any way around this problem?

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Is the unbound control a combo box? If so, what is the format of the combo box rows?

    What is the code in the On Click event of the button on the form?

    The error suggests either the code is not correct, or there is no time data in the table field. How was the table field populated?

  3. #3
    George is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Feb 2012
    Posts
    295
    Yes the control is a combo box with format medium Time.

    You are heading in the right direction, because I actually misrepresented my problem. My problem has nothing to do with the control but rather to do with code having a problem. Here is the area of the code that is relevant:

    If Now() > DateAdd("n", 15, DateValue(Me.Schedule_Arrival) + DateValue(Date)) Then '
    Problem statement is on this line

    MsgBox "I am Late"
    rs.Fields("Punctuality") = "Late"
    Else
    rs.Fields("Punctuality") = "Early"
    MsgBox "I am Late"
    End If

    I have discern that there is a problem with my adding up time.

    What I really want is to add 8:00 AM to DateValue(Date), ie. add time to date.

    Hope this explanation is better.

    But now on reflection I have the solution: If Now() > DateAdd("n", 15, DateValue(Me.Schedule_Arrival)) Then

    I tried this and it's working just leaving out the date part.


    Thanks anyway

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Changes in accde not reflecting in source
    By jobbie in forum Access
    Replies: 20
    Last Post: 11-17-2015, 08:20 AM
  2. Reflecting last date
    By ssworthi in forum Access
    Replies: 1
    Last Post: 07-29-2015, 05:03 PM
  3. Replies: 5
    Last Post: 04-15-2015, 04:20 PM
  4. Replies: 3
    Last Post: 07-31-2013, 08:30 AM
  5. Forms not reflecting changes made on VB Editor
    By fun4all in forum Programming
    Replies: 5
    Last Post: 06-11-2012, 09:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums