Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    Dan9684 is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2019
    Posts
    16


    Quote Originally Posted by Gicu View Post
    Try:

    stLinkCriteria = "[GIOCode]=" & Me![GIOSearch] & " And [MonthEnding]=#" &format(Me![MonthSearch],,"MM/DD/YYYY") & "#"

    Cheers,
    Vlad
    Type mismatch

  2. #17
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    Wrap it in a CDate:

    stLinkCriteria = "[GIOCode]=" & Me![GIOSearch] & " And [MonthEnding]=#" & CDate(Format(Me![MonthSearch],,"MM/DD/YYYY")) & "#"

    Vlad

  3. #18
    Dan9684 is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2019
    Posts
    16
    Quote Originally Posted by Gicu View Post
    Wrap it in a CDate:

    stLinkCriteria = "[GIOCode]=" & Me![GIOSearch] & " And [MonthEnding]=#" & CDate(Format(Me![MonthSearch],,"MM/DD/YYYY")) & "#"

    Vlad
    Still a type mismatch.

  4. #19
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    What data types are the two fields in the table?

  5. #20
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    Sorry, just spotted a spelling mistake (two commas instead of one), try:
    stLinkCriteria = "[GIOCode]=" & Me![GIOSearch] & " And [MonthEnding]=#" & CDate(Format(Me![MonthSearch],"MM/DD/YYYY")) & "#"

    Cheers,
    Vlad

  6. #21
    Dan9684 is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2019
    Posts
    16
    Quote Originally Posted by Gicu View Post
    Sorry, just spotted a spelling mistake (two commas instead of one), try:
    stLinkCriteria = "[GIOCode]=" & Me![GIOSearch] & " And [MonthEnding]=#" & CDate(Format(Me![MonthSearch],"MM/DD/YYYY")) & "#"

    Cheers,
    Vlad
    Thanks, doesn't report a type mismatch any more, just returns a blank record.

    In the frmMain, GIOCode is Number. Field Size = Long Integer, decimal places = Auto
    MonthEnding is Date/Time

    In the frmMenu the GIOSearch and MonthSearch are exactly the same as the corresponding two above.

    It's almost certainly a formatting issue I guess?

  7. #22
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    Have you checked the control names in both forms, are they the same as in your code?

    Cheers,
    Vlad

  8. #23
    Dan9684 is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2019
    Posts
    16
    Quote Originally Posted by Gicu View Post
    Have you checked the control names in both forms, are they the same as in your code?

    Cheers,
    Vlad
    Yep identical

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 07-20-2014, 03:59 PM
  2. Replies: 5
    Last Post: 02-13-2014, 05:27 AM
  3. Replies: 15
    Last Post: 04-17-2012, 01:42 PM
  4. Replies: 11
    Last Post: 03-20-2012, 08:55 AM
  5. Replies: 2
    Last Post: 06-09-2011, 09:47 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