Hallo zusammen,
Ich habe mal wieder eine Frage.
Per VBA erstelle ich mit folgendem Quellcode ein Formular, das funktioniert auch.
Dim ctltxt As Control
Dim strFormName As String
Dim Formname As String
Dim frmCurrentForm As Form
Formname = "test"
Set frm = CreateForm(, "_locPlanung")
frm.RecordSource = "_loc_planung"
DoCmd.Restore
Set ctlText = CreateControl(frm.Name, acTextBox, , "", "Basis")
Set ctlLabel = CreateControl(frm.Name, acLabel, , ctlText.Name, "Basis")
Set ctlText = CreateControl(frm.Name, acTextBox, , "", "Gesamtsumme von M")
Set ctlLabel = CreateControl(frm.Name, acLabel, , ctlText.Name, "Summe Menge")
DoCmd.Restore
frm.DefaultView = 2
DoCmd.Restore
Set frmCurrentForm = Screen.ActiveForm
DoCmd.Close acForm, "Test", acSaveYes
Nun soll das Fenster unter einem bestimmten Namen gespeichert werden und dies ohne Nachfrage.
Das geht leider nicht.
Ersetze ich das "DoCmd.Close acForm, "Test", acSaveYes"
Durch nur Docmd.close, dann speichert ACCESS aber mit einer Nachfrage ja, nein, abbrechen und nach dem Formularnamen, das sollte nicht sein.
Wer kann mir helfen.
Gruß
JOZI
Ich habe mal wieder eine Frage.
Per VBA erstelle ich mit folgendem Quellcode ein Formular, das funktioniert auch.
Dim ctltxt As Control
Dim strFormName As String
Dim Formname As String
Dim frmCurrentForm As Form
Formname = "test"
Set frm = CreateForm(, "_locPlanung")
frm.RecordSource = "_loc_planung"
DoCmd.Restore
Set ctlText = CreateControl(frm.Name, acTextBox, , "", "Basis")
Set ctlLabel = CreateControl(frm.Name, acLabel, , ctlText.Name, "Basis")
Set ctlText = CreateControl(frm.Name, acTextBox, , "", "Gesamtsumme von M")
Set ctlLabel = CreateControl(frm.Name, acLabel, , ctlText.Name, "Summe Menge")
DoCmd.Restore
frm.DefaultView = 2
DoCmd.Restore
Set frmCurrentForm = Screen.ActiveForm
DoCmd.Close acForm, "Test", acSaveYes
Nun soll das Fenster unter einem bestimmten Namen gespeichert werden und dies ohne Nachfrage.
Das geht leider nicht.
Ersetze ich das "DoCmd.Close acForm, "Test", acSaveYes"
Durch nur Docmd.close, dann speichert ACCESS aber mit einer Nachfrage ja, nein, abbrechen und nach dem Formularnamen, das sollte nicht sein.
Wer kann mir helfen.
Gruß
JOZI
Comment