Link to home
Start Free TrialLog in
Avatar of shieldsco
shieldscoFlag for United States of America

asked on

Access 2010 Drill Down From Another Form

I'm trying to drill down from one form to another form using the code below, however I get runtime error 3464 Data Type Mismatch in code  If DCount("*", "UFMS Weakness Remediation Summary", "[Projected RMFP Submission Date] In " & strList) = 0 Then. The data type is number and the table is a linked SharePoint list. Any thoughts...Thanks


Dim strList As String
 strList = "('" & Replace(Me.Projected_RMFP_Submission_Date, " ", "','") & "')"
 If DCount("*", "UFMS Weakness Remediation Summary", "[Projected RMFP Submission Date] In " & strList) = 0 Then
      MsgBox "No related record found", vbExclamation, "ATM"
      Exit Sub
  Else
 End If
 DoCmd.OpenForm "frm_Remediation Summary", , , "[Projected RMFP Submission Date] In " & strList
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You need both the comma and the #.  The list string should look like the following, including the parentheses

(#1/1/2015#, #2/4/2015#, #2/1/2014#)

Put a break in your code so you can examine the expresson after it has been concatenated.
Avatar of shieldsco

ASKER

Thanks ... Very Good
What happens if the value is null
test fierts the content of the control, before proceeding

if Me.Projected_RMFP_Submission_Date & "" <> "" then

  strList = "('" & Replace(Me.Projected_RMFP_Submission_Date, " ", "','") & "')"

 strList=Replace(strList, "'", "#")