Results 1 to 4 of 4
  1. #1
    ExcessionOCP is offline Advanced Beginner
    Windows 11 Office 365
    Join Date
    May 2023
    Posts
    31

    Date box misbehaving after migration to SQL Server

    Hi All,



    I'm hoping someone can help me here because I'm tearing my hair out.

    I have migrated my backend to SQL and everything was fine, until I tried out a particular form which has two date controls on, "DateofPurchase" and "DeliveryDate". There is some code behind the form that takes the month value of these dates and does some maths to decided some other things.

    The issue is that my code has started failing with a type mismatch when I try to read the value of the "Delivery Date" field.

    When I debug.print the typename of each control, the working one shows as "Accessfield" but the non working one shows as "Text Box". Trying to debug.print the control value errors with a type mismatch

    The data type in the SQL backend is set to "Date" for both colums.

    I cannot for the life of me work out what has happened - does anyone have any ideas?

    Thanks in advance.

  2. #2
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    If you open the linked table in design view what datatype does Access think they are?
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    ExcessionOCP is offline Advanced Beginner
    Windows 11 Office 365
    Join Date
    May 2023
    Posts
    31
    Quote Originally Posted by Minty View Post
    If you open the linked table in design view what datatype does Access think they are?
    My god you are a genius! Access thought it was "Date Time Extended" but a quick refresh of the link has sorted that and it works fine now! I changed the date type in the DB ages ago but Access must have been holding on to it.

    THANK YOU!!

  4. #4
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    Quote Originally Posted by ExcessionOCP View Post
    My god you are a genius! Access thought it was "Date Time Extended" but a quick refresh of the link has sorted that and it works fine now! I changed the date type in the DB ages ago but Access must have been holding on to it.

    THANK YOU!!
    Glad it you sorted it. Unlike Access linked tables, it doesn't pick up design changes to SQL tables without a refresh of the link.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

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

Similar Threads

  1. SQL Server Migration
    By hansdbase in forum Access
    Replies: 6
    Last Post: 11-02-2023, 06:13 AM
  2. Replies: 9
    Last Post: 11-23-2022, 03:26 AM
  3. Migration of sharepoint to SQL server
    By meena16 in forum SQL Server
    Replies: 0
    Last Post: 01-14-2020, 01:51 AM
  4. Need help on Access Attachments Migration to SQL server 2014
    By sahadevreddy@gmail.com in forum Import/Export Data
    Replies: 2
    Last Post: 12-23-2016, 01:51 AM
  5. Access To SQL Server Migration
    By Rxp in forum Access
    Replies: 6
    Last Post: 05-07-2012, 05:50 PM

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