..................................................................................
Missy Ed,
Have you got any answer?
After I read your lines I...
Well:
I created a database (why? because it was amusing (-: ) with a table
Created a table with two field: "ID" - autonumber, and "StrDate" - String
I filled up that with "yyyy\/mm\/dd" formated text.
I have a Module1:
Public Function ChildFormOnclick()
'MsgBox Application.Forms(Application.Forms.Count - 1).Caption
DoCmd.Close acForm, Application.Forms(Application.Forms.Count - 1).Name, acSaveNo
End Function
And I have a form, with a CommandButton. The commandButton's onclick sub:
Private Sub Command0_Click()
' Dim rst As Recordset, dbs As Database
Dim frmForm1 As Form
Dim btnCmdButton As New CommandButton
Dim TxtField1, TxtField2 As New TextBox
Set frmForm1 = CreateForm
With frmForm1 'set form
.Width = 10000
.Caption = "Dinamic Form1"
.RecordSource = "Select * FROM MyTable"
.NavigationButtons = False
.Width = 5
.AllowEdits = True
.DividingLines = False
.Section(0).Height = 1100
.AutoCenter = True
.AutoResize = True
.DefaultView = 1 'Continous form
End With
Set btnCmdButton = CreateControl(frmForm1.Name, acCommandButton, acDetail, , , 100, 150, 2000, 500)
With btnCmdButton 'set close button
.OnClick = "=ChildFormOnclick()"
.Caption = "Close form"
.FontSize = 12
.FontBold = True
End With
Set TxtField1 = CreateControl(frmForm1.Name, acTextBox, acDetail, , , 100, 750, 1000, 300)
With TxtField1
.ControlSource = "ID"
End With
Set TxtField2 = CreateControl(frmForm1.Name, acTextBox, acDetail, , , 1200, 750, 1500, 300)
With TxtField2
.ControlSource = "StrDate"
End With
DoCmd.OpenForm frmForm1.Name
End Sub
Creates a form, a "close button" on it, and two textfield:
one for the "ID", one for the "StrDate"
The form is continuous form.
But:
i don't know, how to set the form header (for the command button)
If you have any ideas or example pls. write it down here, or an e-mail:
ide@innocent.com
ide s-)