Find Dialog Box Error

Lily

Registered User.
Local time
Today, 00:30
Joined
Oct 1, 2000
Messages
42
Hello,

I have created a Find Dialog Box that shows a list of Work Order numbers and when you enter a different WO number, it should take you to that record on the form.

Sometimes it gives an error Record Not in List, even though it is. In that case, if I select any other record in the list it will go to that number record. Then I have to re-enter my original records I was looking for in the Find box and it will work.

I have a cboGoToRecord combo box with the event procedure in the After Update. Code is listed below:

Private Sub cboGoToRecord_AfterUpdate()
On Error Resume Next
Dim rst As Object
Set rst = Me.RecordsetClone
rst.FindFirst "WID=" & Me.cboGoToRecord.Value
Me.Bookmark = rst.Bookmark

End Sub


The WID number is actually the autonumber. Work_OrderMain is the actual seven digit number I type in the find dialog box.

The query behind the Find box has two columns: WID and Work_OrderMain.

Thanks for any advice. It is greatly appreciated.

Best Regards,

Lisa
 
Sometimes it gives an error Record Not in List
What is "it?" Where exactly does the error occur? Do you get a pop-up message box that allows you to break into code? It's not exactly clear to me how this fails.

Also, there is a risk to having such a broad error handler as this . . .
Code:
On Error Resume Next
. . . since it will have the effect of hiding unexpected errors that you should know about. During development at least, comment out that error handler and see if you get a new error.
 
I would suggest separating the Dialogue from the Data Form.

Code:
Function ProducersDialoguePayments_Review()

    With CodeContextObject
    
        If Len(.[Method]) = 0 Then
            DoCmd.OpenForm "Producers Review Payments", acNormal, "", "", acFormEdit, acWindowNormal
        Else
            DoCmd.OpenForm "Producers Review Payments", acNormal, "", "[Producer Trans Method] = '" & .[Method] & "'", acFormEdit, acWindowNormal
        End If
        
        DoCmd.OpenForm "Producers Dialogue Payments", acNormal, "", "", acFormEdit, acHidden
    End With
End Function

A command Button on the data form to Select another Work Order .

Simon
 

Users who are viewing this thread

Back
Top Bottom