Hello all,
I'm a bit green with VB so appologies up front!!!!
Does anyone know of a way to stop the pop-up boxes for make table and append queries, and to default to OK???
I would like to run this little bit of code automaticly without having to click OK a million times!!!!
Here is a snippet of my code...
Private Sub Audi_Import_Click()
Dim Response
Response = MsgBox("! WARNING !" & Chr(13) & "Are you sure you want to do this???", vbYesNo)
If Response = vbNo Then End
DoCmd.OpenForm "Form - Please wait", acNormal
DoCmd.RepaintObject acForm, "Form - Please wait"
On Error Resume Next
DoCmd.DeleteObject acTable, "Table - Audi - Backup"
On Error GoTo Err_Audi_Import_Click
DoCmd.Rename "Table - Audi - Backup", acTable, "Table - Audi - Internal data"
DoCmd.OpenQuery "Conversion - Audi - Database Conversion", acViewNormal, acEdit
DoCmd.CopyObject , "Table - Audi - Internal data", acTable, "Blank - Audi"
DoCmd.OpenQuery "Conversion - Audi - Append", acViewNormal, acEdit
DoCmd.DeleteObject acTable, "Table - Audi - Converted"
DoCmd.Close acForm, "Form - Please wait"
Exit_Audi_Import_Click:
Exit Sub
Err_Audi_Import_Click:
MsgBox Err.Description
Resume Exit_Audi_Import_Click
End Sub
Many thanks
I'm a bit green with VB so appologies up front!!!!
Does anyone know of a way to stop the pop-up boxes for make table and append queries, and to default to OK???
I would like to run this little bit of code automaticly without having to click OK a million times!!!!
Here is a snippet of my code...
Private Sub Audi_Import_Click()
Dim Response
Response = MsgBox("! WARNING !" & Chr(13) & "Are you sure you want to do this???", vbYesNo)
If Response = vbNo Then End
DoCmd.OpenForm "Form - Please wait", acNormal
DoCmd.RepaintObject acForm, "Form - Please wait"
On Error Resume Next
DoCmd.DeleteObject acTable, "Table - Audi - Backup"
On Error GoTo Err_Audi_Import_Click
DoCmd.Rename "Table - Audi - Backup", acTable, "Table - Audi - Internal data"
DoCmd.OpenQuery "Conversion - Audi - Database Conversion", acViewNormal, acEdit
DoCmd.CopyObject , "Table - Audi - Internal data", acTable, "Blank - Audi"
DoCmd.OpenQuery "Conversion - Audi - Append", acViewNormal, acEdit
DoCmd.DeleteObject acTable, "Table - Audi - Converted"
DoCmd.Close acForm, "Form - Please wait"
Exit_Audi_Import_Click:
Exit Sub
Err_Audi_Import_Click:
MsgBox Err.Description
Resume Exit_Audi_Import_Click
End Sub
Many thanks