I'm new to VB and believe I have been writing code badly. But I am right now doing a Performance Analyzer on my database, because it is very slow and a couple forms have had error messages: "Not enough memory to open... close all programs" and not able to open. But after I did the Performance Analyzer it said to use an "Option Explicit statement" for several of my codes. Due to my no formal education in really any type of programming I often leave out the "Dim variable as String" which I believe is what the "Option Explicit statement" is referring to. However for some of the forms it recommends this for, the only code I have is:
Referenced from a module:
My question is, do I stil need to declare some variable for my intial code? even though it's one line calling a function. And if so, what should it be??
Thanks for any help or tips to my problem
Code:
Private Sub Image0_DblClick(Cancel As Integer)
CandO Me.Name, "xxfrmaddorviewinformation"
End Sub
Referenced from a module:
Code:
Public Function CandO(strClose As String, strFormName As String)
strFormName = xxfrmaddorviewinformationxx
DoCmd.Close acForm, strClose, acSavePrompt
DoCmd.OpenForm "xxfrmaddorviewinformationxx"
End Function
My question is, do I stil need to declare some variable for my intial code? even though it's one line calling a function. And if so, what should it be??
Thanks for any help or tips to my problem