If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Combo error
I receive a run-time error 2147352567 (80020009) when I up date the form and
then using the combo155 to go to advance to another record. The error in SQL always highlights the LastModified = date in the beforeUpdate. Please show me the error I have created. Thank you Private Sub Combo155_AfterUpdate() ' Find the record that matches the control. Dim rs As Object Set rs = Me.Recordset.Clone rs.FindFirst "[SSI] = '" & Me![Combo155] & "'" If Not rs.EOF Then Me.Bookmark = rs.Bookmark End Sub Private Sub Form_BeforeUpdate(Cancel As Integer) If Me.Dirty = True Then If MsgBox("Do you wish to save the changes?", vbQuestion + vbYesNo, "Save Record?") = vbNo Then Cancel = True Me.Undo Else LastModified = date End If End If |
#2
|
|||
|
|||
Combo error
"Nick" wrote in message
... I receive a run-time error 2147352567 (80020009) when I up date the form and then using the combo155 to go to advance to another record. The error in SQL always highlights the LastModified = date in the beforeUpdate. Please show me the error I have created. Thank you Private Sub Combo155_AfterUpdate() ' Find the record that matches the control. Dim rs As Object Set rs = Me.Recordset.Clone rs.FindFirst "[SSI] = '" & Me![Combo155] & "'" If Not rs.EOF Then Me.Bookmark = rs.Bookmark End Sub Private Sub Form_BeforeUpdate(Cancel As Integer) If Me.Dirty = True Then If MsgBox("Do you wish to save the changes?", vbQuestion + vbYesNo, "Save Record?") = vbNo Then Cancel = True Me.Undo Else LastModified = date End If End If Does this error occur if you modify the record and then go to another record, without using the combo box? What is "LastModified"? Is it a bound control on your form? In general, before navigating to another record, it's a good idea to explicitly save the current one, if it has been modified. Here's a slightly better procedure for your combo box's AfterUpdate event: '------ start of modified code ------ Private Sub Combo155_AfterUpdate() ' Find the record that matches the control. If Me.Dirty Then Me.Dirty = False With Me.RecordsetClone .FindFirst "[SSI] = '" & Me![Combo155] & "'" If Not .NoMatch Then Me.Bookmark = .Bookmark End If End With End Sub '------ end of modified code ------ But I'm not sure exactly what caused your error, so I can't guarantee that this will solve it. -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup) |
Thread Tools | |
Display Modes | |
|
|