Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Access 2000: Problem beim Abspeichern von Datensätzen

Empfohlene Antworten

Veröffentlicht

Moin moin, hoffe ihr hatten alle nen schönes Osterfest :) Ich hab (eigentlich schon seit Monaten) ein Problem in meiner VB Anweisung zum Abspeichern der Datensätze eines Accessformulares. Formular soll ausgefüllt und dann die Datensätze beim Drücken auf Speichern in die Tabelle geschrieben werden. Das klappt auch in den meisten Fällen. Erstmal der Code:

Private Sub Befehl112_Click()

Dim db0 As Database

Dim rst As Recordset

Set db0 = CurrentDb

Set rst = db0.OpenRecordset("tblPersonen", dbOpenDynaset)

If FID.Value <> "" And Not IsNull(FID.Value) Then

If FName.Value <> "" And Not IsNull(FName.Value) Then

If FVorname.Value <> "" And Not IsNull(FVorname.Value) Then

If FTitel.Value <> "" And Not IsNull(FTitel.Value) Then

If FZusatz.Value <> "" And Not IsNull(FZusatz.Value) Then

'If FGeburtsdatum.Value <> "" And Not IsNull(FGeburtsdatum.Value) Then

'If FBeginnAV.Value <> "" And Not IsNull(FBeginnAV.Value) Then

'If FEndeAV.Value <> "" And Not IsNull(FEndeAV.Value) Then

rst.AddNew

rst![iD] = FID.Value

rst![sYSDAT] = Now()

rst![Name] = FName.Value

rst![Vorname] = FVorname.Value

rst![Titel] = FTitel.Value

rst![Zusatz] = FZusatz.Value

' rst![Gebdatum] = FGeburtsdatum.Value

' rst![AVAnf] = FBeginnAV.Value

' rst![AVEnd] = FEndeAV.Value

rst.Update

' End If

' End If

' End If

End If

End If

End If

End If

End If

rst.Close

MsgBox ("Done!")

Ab und zu kommt es allerdings vor, dass die Datensätze ohne Fehlermeldung nicht in die Tabelle eingetragen werden. Wenn ich dann die drei Datensätze (hier mit einem Hochkomma versehen) Gebdatum, AVAnf und AVEnd auskommentiere, funktioniert alles wieder perfekt. Kurioserweise läuft auch alles dann wieder, wenn ich die drei Felder wieder einbinde. Die Datentypen der Felder und die der Tabelle sollten eingentlich übereinstimmen. Hat da wer eine Idee? Ich weiß da absolut nimma weiter.

Liebe Grüße,

fishy

Hallo!

Vielleicht hast Du einfach ein falsches Datumsformat. Ich nehme mal an, das Du den Datentyp Date für die Felder hast. Versuchs mal so:

---------------------------------------------------------------------

If IsNull(rsFGeburtsdatum) Then rst![Gebdatum] = "Null"

Else

rst![Gebdatum] = "#" & Format(rsFGeburtsdatum, "mm-dd-yyyy hh:nn:ss") & "#"

End If

---------------------------------------------------------------------

Gruß

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.