#Deleted refresh error
I have created an if statement that handles a delete request for my delete command button as follows:
DoCmd.SetWarnings False ' Turn off Access warning messages
If MsgBox("Would you like to delete current record? ", vbYesNo, "Delete Record") = _
vbYes Then
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
DoCmd.SetWarnings True ' Warning set on again
DoCmd.GoToRecord , , acFirst ' Return to first record in database
Else
DoCmd.SetWarnings True ' Warning set on again
Exit Sub
End If
The code works fine. My problem is the form that uses this code, as it acts as both an entry form and record navigation form. On the form I have provided a quick search function in the form of a combo box. My problem is that as soon as a relevant record is deleted the wording #Deleted appears to represent the now deleted record. Is there away that I might be able to refresh the combo box to take into account the change in the database data?
I really appreciate somebody's help, The database is almost complete I am just trying to overcome these minor bugs.
Garry
Gaz
__________________
Gaz
|