Compile Error

  • Thread starter Thread starter Del
  • Start date Start date
D

Del

What is wrong with this code. I get a compile error on "!cboCycle" that says
"Method or data member not found". If I change !cboCycle to !cboDept I get
the same error but !cboDept compiled earlier in this code.

DoCmd.RunSQL "UPDATE tblEquip INNER JOIN tblPMCurrentTasks ON
tblEquip.EquipID=tblPMCurrentTasks.EquipID " & _
"Set tblPMCurrentTasks.[PerformedBy]='" & Me.txtPerformedBy &
"',tblPMCurrentTasks.[Done]= -1, " & _
"tblPMCurrentTasks.[DateDone]=#" & Date & "#" & _
"Where tblEquip.[Dept]='" & Forms!frmPM!cboDept & "' And
tblPMCurrentTasks.[PMCycle]='" & _
Forms!frmPM!cboCycle & "' And tblEquip.[Line]='" & Me.cboLine &
"' And tblEquip.[EquipID]= " & _
Forms!frmPM!txtEquipID & "and tblPMCurrentTasks.[Done]<>-1;"
 
Del,
Access gives this error, but not necessarily at the exact spot in the code.
In the posted code, these is a field, control, value that access can't find.
The quick way to troubleshoot is to go stepwise (from my experience at
least)
I do it like this:
Comment out all except the first line of the code sample, if that bit
compiles OK, then uncomment the second line and compile, if no errors,
uncomment the next line and compile, repeat until you find the troublesome
field or control.

Jeanette Cunningham
 
Back
Top