New to VB applications....
Can anybody find anything wrong with this snippet of code?
I attached it (as "=ClearForm()" ) to a button I put on a Form to activated with a 2ble click. The message returned is a run-time 7874 error with words to the effect that the system cannot find the object named in the first Docmd. My guess would be that there's a problem with the naming convention, but what?
Option Explicit
Function ClearForm()
DoCmd.OpenQuery "[Normalizing Target Lesions Data]", acViewNormal, acReadOnly
DoCmd.Close acQuery, "[Normalizing Target Lesions Data]", acSavePrompt
DoCmd.OpenQuery "[Convert Union Query Result into Table]", acViewNormal, acReadOnly
DoCmd.Close acQuery, "[Convert Union Query Result into Table]", acSavePrompt
DoCmd.OpenQuery "[Sum of Target Lesions Query]", acViewNormal, acReadOnly
DoCmd.Close acQuery, "[Sum of Target Lesions Query]", acSavePrompt
DoCmd.OpenQuery "[Make Table w/ Visit Sums]", acViewNormal, acReadOnly
DoCmd.Close acQuery, "[Make Table w/ Visit Sums]", acSavePrompt
End Function
Can anybody find anything wrong with this snippet of code?
I attached it (as "=ClearForm()" ) to a button I put on a Form to activated with a 2ble click. The message returned is a run-time 7874 error with words to the effect that the system cannot find the object named in the first Docmd. My guess would be that there's a problem with the naming convention, but what?
Option Explicit
Function ClearForm()
DoCmd.OpenQuery "[Normalizing Target Lesions Data]", acViewNormal, acReadOnly
DoCmd.Close acQuery, "[Normalizing Target Lesions Data]", acSavePrompt
DoCmd.OpenQuery "[Convert Union Query Result into Table]", acViewNormal, acReadOnly
DoCmd.Close acQuery, "[Convert Union Query Result into Table]", acSavePrompt
DoCmd.OpenQuery "[Sum of Target Lesions Query]", acViewNormal, acReadOnly
DoCmd.Close acQuery, "[Sum of Target Lesions Query]", acSavePrompt
DoCmd.OpenQuery "[Make Table w/ Visit Sums]", acViewNormal, acReadOnly
DoCmd.Close acQuery, "[Make Table w/ Visit Sums]", acSavePrompt
End Function