none
The value you entered isn't valid for this field RRS feed

  • Question

  • I have a form with a combobox that I populate with dates.  I've formatted the control as Long Date.  All is fine until I select a value, at which point I receive the message "The value you entered isn't valid for this field".  If I change the format to Medium Date, it seems to work, but I need the user to see the day of week (Long Date).

    Any ideas?


    Thanks for your help!!

    Friday, January 27, 2017 8:25 PM

Answers

  • I'm not sure I fully understand this suggestion.  I need the user to see the Long Date format (that is, they need to see the day of the week).  I will then use that date for further processing.

    Hi plynton,

    In that case, can you extend the combobox with an additional (visible) column with the formatted date, such as:

           "SELECT [Order Date], Format([Order Date],"Long Date")  AS Order_longdate FROM tblOrders WHERE StoreID = " & Me.StoreID & " ORDER BY [Order Date] DESC"

    Imb.

    • Marked as answer by plynton Sunday, January 29, 2017 1:45 PM
    Saturday, January 28, 2017 2:01 PM

All replies

  • Hi,

    Can you post the RowSource for your combobox? Thanks.

    Friday, January 27, 2017 8:28 PM
  • Assuming your combobox is bound to a table - then it is trying to put data into a table's field.  Check what are the parameters of that field - and see if this makes sense for the type data being selected by the combobox.

    The combobox itself has format properties - this is another place to check.

    Keep in mind that the value displayed by the combobox is not necessarily the value actually stored - you need to know the bound value/field. A typical misunderstanding is seeing the displayed value but what is actually being bound from the combobox's record source is the key value of the record.


    • Edited by msdnPublicIdentity Friday, January 27, 2017 8:35 PM
    • Proposed as answer by threni Wednesday, June 26, 2019 12:05 PM
    Friday, January 27, 2017 8:34 PM
  • I generate the RowSource based on user input:
    "SELECT [Order Date] from tblOrders WHERE StoreID = " & Me.StoreID & " ORDER BY [Order Date] DESC;

    The combobox is unbound.

    Thanks again.

     

    Thanks for your help!!

    Saturday, January 28, 2017 1:15 PM
  • I've formatted the control as Long Date.  

    Hi plynton,

    You can try to remove the format of the control.

    If there is user input, you can check for a valid date in the BeforeUpdate event.

    Then in the AfterUpdate event you can set the value in the Long Date format.

    Imb.

    Saturday, January 28, 2017 1:46 PM
  • I'm not sure I fully understand this suggestion.  I need the user to see the Long Date format (that is, they need to see the day of the week).  I will then use that date for further processing.

    Thanks for your help!!

    Saturday, January 28, 2017 1:51 PM
  • I'm not sure I fully understand this suggestion.  I need the user to see the Long Date format (that is, they need to see the day of the week).  I will then use that date for further processing.

    Hi plynton,

    In that case, can you extend the combobox with an additional (visible) column with the formatted date, such as:

           "SELECT [Order Date], Format([Order Date],"Long Date")  AS Order_longdate FROM tblOrders WHERE StoreID = " & Me.StoreID & " ORDER BY [Order Date] DESC"

    Imb.

    • Marked as answer by plynton Sunday, January 29, 2017 1:45 PM
    Saturday, January 28, 2017 2:01 PM