D
Dymondjack
Thanks in advance
I'm running a search field on my form using the dao findfirst/bookmark
method. This worked great during development, and for some reason now I am
getting an error. Here's the problem area code...
'CODE START
Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo Error_Form_BeforeUpdate
Dim xMsg As String, xBtns As Variant, xTitle As String
'=========================
'=========================
Me.ctlDateModified = Now()
If Me.NewRecord = True Then
Me.ctlDateCreated = Now()
End If
'=========================
Exit_Form_BeforeUpdate:
Exit Sub
Error_Form_BeforeUpdate:
End Sub
'AND...
Private Sub ctlGetDoc_Exit(Cancel As Integer)
On Error GoTo Error_ctlGetDoc_Exit
Dim xMsg As String, xBtns As Variant, xTitle As String
'=========================
Dim rs As Recordset
'=========================
Set rs = Me.RecordsetClone
rs.FindFirst "[fldID] = '" & Me.ctlGetDoc.Text & "'"
If rs.NoMatch Then
MsgBox "The Document you have entered does not exist."
Me.ctlGetDoc.Text = ""
Else
Me.ctlGetDoc.Text = ""
Me.Bookmark = rs.Bookmark
End If
Set rs = Nothing
'CODE END (left out error handling... redundant)
Here's whats happening... the Me.bookmark line is executing, at which point
the code jumps to Form_BeforeUpdate, where I now recieve 'Error 6 - Overflow'
on the me.ctlDateModified = Now() line (this particular record has not been
changed, so I'm not even sure why its going here...). Then it jumps directly
to the error handler of ctlGetDoc_Exit. When debugging to Resume (one down
from Resume Exit_ctlGetDocExit), the error comes from the Me.Bookmark =
rs.Bookmark line.
This error is 3020: Update or CancelUpdate without Addnew or Edit in module
Form_frmDocuments, procedure ctlGetDoc_Exit
My only thought on this is that the control in the header portion of my form
(ctlGetDoc) is triggering an update to the form, even though it is unbound,
at which point the error is being thrown...
Any ideas?
Thanks much...
I'm running a search field on my form using the dao findfirst/bookmark
method. This worked great during development, and for some reason now I am
getting an error. Here's the problem area code...
'CODE START
Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo Error_Form_BeforeUpdate
Dim xMsg As String, xBtns As Variant, xTitle As String
'=========================
'=========================
Me.ctlDateModified = Now()
If Me.NewRecord = True Then
Me.ctlDateCreated = Now()
End If
'=========================
Exit_Form_BeforeUpdate:
Exit Sub
Error_Form_BeforeUpdate:
End Sub
'AND...
Private Sub ctlGetDoc_Exit(Cancel As Integer)
On Error GoTo Error_ctlGetDoc_Exit
Dim xMsg As String, xBtns As Variant, xTitle As String
'=========================
Dim rs As Recordset
'=========================
Set rs = Me.RecordsetClone
rs.FindFirst "[fldID] = '" & Me.ctlGetDoc.Text & "'"
If rs.NoMatch Then
MsgBox "The Document you have entered does not exist."
Me.ctlGetDoc.Text = ""
Else
Me.ctlGetDoc.Text = ""
Me.Bookmark = rs.Bookmark
End If
Set rs = Nothing
'CODE END (left out error handling... redundant)
Here's whats happening... the Me.bookmark line is executing, at which point
the code jumps to Form_BeforeUpdate, where I now recieve 'Error 6 - Overflow'
on the me.ctlDateModified = Now() line (this particular record has not been
changed, so I'm not even sure why its going here...). Then it jumps directly
to the error handler of ctlGetDoc_Exit. When debugging to Resume (one down
from Resume Exit_ctlGetDocExit), the error comes from the Me.Bookmark =
rs.Bookmark line.
This error is 3020: Update or CancelUpdate without Addnew or Edit in module
Form_frmDocuments, procedure ctlGetDoc_Exit
My only thought on this is that the control in the header portion of my form
(ctlGetDoc) is triggering an update to the form, even though it is unbound,
at which point the error is being thrown...
Any ideas?
Thanks much...