K
Kerry
Hi
Please could someone help me work out why this isn't
working (copy of code below). I hope/think it is just
something silly but have tried and tried. This procedure
will work fine if I use just one set of criteria, it
doesn't like 2. I found some info through google which
suggested I put my criteria into variables first when
using multi criteria but now I am getting error "Data
type mismatch in criteria expression. (Error 3464)"
Many Thanks
Kerry
-----------------
Private Sub To_AfterUpdate()
DoCmd.Save
siteF = Me.From
siteT = Me.To
RecMiles = DLookup("[Mileage (Miles)]", "Qry Miles & Dur
Calc", "[Start] = '" & siteF & "' And [End] = " & siteT)
'RecDur = DLookup("[Duration (Mins)]", "Qry Miles & Dur
Calc", "[start] = " _
& Me.From)
'And "[end] = " & Me.To)
Me.Mileage = RecMiles
Me.Duration = RecDur
End Sub
Please could someone help me work out why this isn't
working (copy of code below). I hope/think it is just
something silly but have tried and tried. This procedure
will work fine if I use just one set of criteria, it
doesn't like 2. I found some info through google which
suggested I put my criteria into variables first when
using multi criteria but now I am getting error "Data
type mismatch in criteria expression. (Error 3464)"
Many Thanks
Kerry
-----------------
Private Sub To_AfterUpdate()
DoCmd.Save
siteF = Me.From
siteT = Me.To
RecMiles = DLookup("[Mileage (Miles)]", "Qry Miles & Dur
Calc", "[Start] = '" & siteF & "' And [End] = " & siteT)
'RecDur = DLookup("[Duration (Mins)]", "Qry Miles & Dur
Calc", "[start] = " _
& Me.From)
'And "[end] = " & Me.To)
Me.Mileage = RecMiles
Me.Duration = RecDur
End Sub