common code sequence

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This is in reference to a previous post "Bypassing Update" on 3/25. I copied
the code from the control to a sub in the general declarations section and
then called it from the On Current event of the form. When I open the form I
get an error message:
"The expression On Current you entered as the event property setting
produced the following error: Member already exist in an object module from
which this object module derives."
What am I doing wrong?
Below is my code:

Private Sub LastLocation()
If IsNull(DLookup("Odometer", "qryLastLocation")) Then
Me.LastOdometer = DLookup("BeginningOD", "tblTrucks", _
"TruckID='" & Me.TruckID & "'")
Me.LastLocation = DLookup("BeginningLocation &', ' &
BeginningState", _
"tblTrucks", "TruckID='" & Me.TruckID & "'")
Else
Me.LastOdometer = DLookup("Odometer", "qryLastLocation")
Me.LastLocation = DLookup("Location", "qryLastLocation")
End If
End Sub

Thanks for your help!
 
You probably still got an object on the form named LastLocation, either
change the object name or the sub name.
 
Thanks! That was the same name as a control.

Ofer Cohen said:
You probably still got an object on the form named LastLocation, either
change the object name or the sub name.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top