I've also been looking at Dev Ashish's terrific site, and came across this:
http://www.mvps.org/access/forms/frm0034.htm
Everything works step-by-step from the calling form and into the module, but
fails on the line:
".DoCmd.OpenForm strForm, intView", where the error message is "Error#:
2046 The command or action 'OpenForm" isn't available now."
Any ideas from the gurus?
Al Aston
Option Compare Database
Option Explicit
Const strExposed As String = "Attribute VB_Exposed = True" & vbCrLf
Const strStartModule = "CodeBehindForm"
Sub ExposeForm(strFormName)
Dim strFromPath As String, StrToPath As String, intFileNumber As Integer,
_
lngLen As Long, lngLeft As Long, _
strBuffer As String, strLeft As String, strRight As String
strFromPath = Environ("Temp") & "\" & strFormName & "_Original.Txt"
StrToPath = Environ("Temp") & "\" & strFormName & "_Revised.Txt"
Application.SaveAsText acForm, strFormName, strFromPath
lngLen = FileLen(strFromPath)
intFileNumber = FreeFile
Open strFromPath For Input As #intFileNumber
strBuffer = Input(lngLen, #intFileNumber)
lngLeft = InStr(strBuffer, strStartModule) + Len(strStartModule)
strLeft = left(strBuffer, lngLeft) & vbCrLf
strRight = Mid(strBuffer, lngLeft + 2)
strBuffer = strLeft & strExposed & strRight
Close #intFileNumber
intFileNumber = FreeFile
Open StrToPath For Output As #intFileNumber
Print #intFileNumber, strBuffer
Close #intFileNumber
Application.LoadFromText acForm, strFormName, StrToPath
End Sub
"Al Aston" <aas...@mindspring.com> wrote in news:ai4o5j$ptb$1
@nntp9.atl.mindspring.net:
--
Lyle