Question : Acess Run time Error


Hi, if a user presses a command button that has already been actioned they get the run time error

3380 with the reason

Can i put some code in that creates a personalised message box (As opposed to the current Microsoft Error)

Thanks
Seamus

Answer : Acess Run time Error

Try

Private Sub Command0_Click()
Dim db As Database
Set db = CurrentDb

On Error GoTo Err_Here

DoCmd.SetWarnings False

CurrentDb.Execute SQL
mySQL = "ALTER TABLE [Employees who have matched to Market] ADD [Plug or Match] varchar(5)"
db.Execute mySQL
mySQL = "UPDATE [Employees who have matched to Market] SET [Plug or Match] = ""Matched"""

MsgBox "Flag Applied"

DoCmd.SetWarnings True

db.Execute mySQL

Exit Sub

Err_Here:

MsgBox "XYZ"





End Sub
Random Solutions  
 
programming4us programming4us