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.

Warum kann Access nicht zählen ???

Empfohlene Antworten

Veröffentlicht

moin FI*'s,

Folgendes Problem:

Der folgende Code ...


Dim DB As Database

Dim RS As Recordset

Set DB = CurrentDb

Set RS = DB.OpenRecordset("Tabelle")


RS.MoveFirst

If Me.CurrentRecord = RS.RecordCount Then

   MsgBox "HALLO"

End If

... liefert mir in sofern einen Fehler, das ich bei drei vorhandenen Datensätzen, in der If- Abfrage als Ergebnis "True" bekomme und deshalb eine MessageBox mit der Nachricht "Hallo". Normalerweise müsste es aber False ergeben, denn 1 <> 3. Weiß einer von euch, wie ich Access zum richtigen Zählen ermutigen kann?

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

mfg maddin

.recordcount kannst du nur abfragen, wenn du die tabelle mit dbOpenTable geöffnet hast. Dynasets und Snapshots bauen sich dynamisch auf, und liefern erst das richtige ergebnis, wenn du .movelast aufgerufen hast.

die tabelle kannst du aber ganz einfach so durchlaufen:

set rs = currentdb.openrecordset("tabelle1")

rs.movefirst

while not rs.eof

debug.print cstr(rs.absoluteposition) & _

":" & _

cstr(rs.fields(0).value)

rs.movenext

wend

oder so...

set rs = currentdb.openrecordset("tabelle1")

rs.movelast: rs.movefirst

for i = 1 to rs.recordcount

debug.print cstr(rs.absoluteposition) & _

":" & _

cstr(rs.fields(0).value)

rs.movenext

next

guckst du zählt demn access jetzt wink.gif

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.