Hi, I copied the forms (ActionItem, Reminders) from another database. There
was no error in running the form but when I run the form my database it gives
error. Sometimes it gives errorthat it cannot find the form "formAllrecords"
referred to in macro exression or VB code, and sometimes it gives error that
the object doesn't support this property or method. I've checked the VB code
and it's being called two times in the form.
1.
Private Sub cmdSet_Click()
' Validate that text filled in before saving reminder
' Save the record
On Error GoTo HandleErr
If IsNull(Me!txtTicklerText) Then
MsgBox "Please fill in some reminder text before " _
& "saving your reminder.", , "Can't Save Reminder"
Me!txtTicklerText.SetFocus
Else
Me!ContactID = Forms!formAllrecords!ContactID "this is where its
being called 1st"
DoCmd.RunCommand acCmdSaveRecord
' And prepare to add another record
DoCmd.GoToRecord acDataForm, Me.Name, acNewRec
EnableSet
End If
ExitHere:
Exit Sub
HandleErr:
Select Case Err
Case Else
MsgBox Err & ": " & Err.Description, vbCritical, _
"Error in Form_ActionItem.cmdSet_Click"
End Select
Resume ExitHere
Resume
End Sub
2.
Private Sub SetFormCaption(strText As String)
On Error GoTo HandleErr
With [Forms]![formAllrecords] "This is where its being called the second
time"
strText = strText & !FirstName & " " & !LastName _
& " - " & !Company.Column(1)
End With
Me.Caption = strText
ExitHere:
Exit Sub
HandleErr:
Select Case Err
Case Else
MsgBox Err & ": " & Err.Description, vbCritical, _
"Error in Form_ActionItem.SetFormCaption()"
End Select
Resume ExitHere
Resume
End Sub
I'm stuck on this for days,
can you tell me where is it going wrong. thanks
AJ
JohnFol said:
There is no built in method called SetFormCaption so I guess it's a routine
that exists only in your form. Check to see if you can find it, or if not,
step through the code to see where it's being called.