I had a duplicate button on my form that worked perfect..
Private Sub cmdDuplicate_Click()
Dim Inspection As Integer
Inspection = Me.txtInspection.Value
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.RunCommand acCmdPasteAppend
Me.txtInspection.Value = DMax("[Inspection #]", "[Enter Inspection]") + 1
Exit_CopyRecord:
Exit Sub
End Sub
However, I added a combobox search
Private Sub cboNumberSearch_AfterUpdate()
Me.Filter = "[Inspection #]= " & cboNumberSearch
Me.FilterOn = True
End Sub
And my duplicate button no longer works. It comes up with an error that says my primary key is being duplicated. However the primary key is NOT the inspection # you see listed above, though that will no longer add +1.
Any suggestions?
If you need any clarification, please ask.. I understand this post was confusing!
Thanks in advance for the help!
alyon