Announcement

Collapse
No announcement yet.

Problem mit Formular erstellen per VBA (createForm

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem mit Formular erstellen per VBA (createForm

    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

  • #2
    Servus,

    du must einfach die Änderrung Speichern Abfrage mit

    docmd.setwarnings false

    umgehen..

    Comment


    • #3
      z.B.

      'Anweisung

      DoCmd.SetWarnings False
      DoCmd.Close acForm, "Test"
      DoCmd.SetWarnings True

      'Anweisun

      Comment

      Working...
      X