Form Refresh Error

illy2k

Registered User.
Local time
Today, 22:24
Joined
Apr 21, 2003
Messages
51
Ok, I have been going through someone elses Access Database to try to make it work for the client it was originally designed for. The database is coded very poorly and I have to try to figure out what is going on. They needed to change the AuditNo field in a table to AuditDate. AuditNo used to be the primary key, but the table structure has changed somewhat. Anyway, I got rid of all the references to the AuditNo field. I went through all the modules and code within the form and found everything and recoded. However when I try to do Me.Refresf or Me.Form.Refresh I get a box that has a caption, "Enter Parameter Value", tblSupplierHWSW.AuditNo. And I have no idea where this AuditNo is coming from, is it some reference I cannot find or is this something deeper? I mean I even debugged and stepped through the code to try to catch the reference and it just errors on the Me.Refresh. Here is the code for reference:

Private Sub Combo119_AfterUpdate()
On Error GoTo Combo119_AfterUpdate
DoCmd.SetWarnings False

Dim AuditDate As Date
Dim CurRow As Integer

' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone

CurRow = CInt(Me![Combo119].Column(1))
AuditDate = Me![Combo119].Column(0)

rs.FindFirst "[AuditDate] = #" & AuditDate & "#" ' And "[ItemNo] = " & CurRow

If CurRow > 1 Then
rs.FindNext "[ItemNo] = " & CurRow

End If

Me.Bookmark = rs.Bookmark
Me.Refresh <----- Here it errors out

DoCmd.SetWarnings True
Exit Sub

Combo119_AfterUpdate:

MsgBox Error$
DoCmd.SetWarnings True
End Sub
 
Go into design view and look at the datasource/control source of the objects on your form.

It would be easier to help if you just attached the database.
 
Hi illy2k,

Among other things I hope you realize you have two (2) Combo119_AfterUpdate labels.

Private Sub Combo119_AfterUpdate() is 1 - and

Combo119_AfterUpdate: is the other. Where did you want the code to go with:

On Error GoTo Combo119_AfterUpdate

Maybe Access is getting confused, I am!
 
Yes, I missed that. Use a different naming scheme:

Replace the error handler with something a little more descriptive, like:

On Error Goto Err_Procedure
Err_Procedure:
 

Users who are viewing this thread

Back
Top Bottom