Re: bookmark

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



hallo an alle
erstmal vielen dank für die hilfe

ich hab einiges geändert dank euerer tips

aber mein hauptproblem ist leider noch nicht gelöst

ich hab mich vielleicht schlecht ausgedrückt deshalb in kürze nochmal


code select.....
End Select
' anzeige sortierte daten z.b.5 stück
' anklicken in der liste datensatz 3
' aktuelle datensatznr also 3 in eine variable speichern (aber nur die
nummer oder position)

varlesezeichen = "variable" z.b. inhalt 3

DoCmd.OpenForm "Daten_bearbeiten", acNormal, sqlbefehl
DoCmd.GoToRecord acDataForm, "Daten_bearbeiten", acGoTo, varlesezeichen

wenn ich direkt einer 3 reinschriebe springt er mir auch da hin.

gruß und nochmals für die hilfe bis jetzt vielen dank

philippe

"Henry Habermacher" schrieb:

Hallo Philippe

Philippe Malmedé wrote:

Set rs = db.OpenRecordset(sqlbefehl, dbOpenSnapshot)

VarLesezeichen = rs.Bookmark

MsgBox VarLesezeichen

DoCmd.OpenForm "Daten_bearbeiten", acNormal
rs.Bookmark = VarLesezeichen
End Sub

alles klappt nur nicht wenn ich das open form aufmache er automatisch den
letzten aktiven datensatz anspringt sonder er geht immer zum ersten aus
dem sqlbefehl

Der Bookmark ist nur dann identisch, wenn das Recordset identisch ist. Wenn
Du den Bookmark von rs verwenden willst, darfst Du das Form nicht ein
eigenes Recordset anlegen lassen, auch wenn das SQL Statement idenitsch ist.
Du musst dann dem Form das Recordset (rs) zuweisen, damit Du die Bookmarks
verwenden kannst.

Setze nach dem Öffnen des Forms dessen Recordset auf rs:
Set Forms("DatenBearbeiten").Recordset = rs

Ich hab's nicht getestet, denke aber, dass dann der Bookmark funktioniert.

Details siehe OH von Access (c) Microsoft, A2007 VBA Help, Topic:
Recordset.Bookmark Property:

"[..]If you use the Clone method to create a copy of a Recordset object, the
Bookmark property settings for the original and the duplicate Recordset
objects are identical and can be used interchangeably. However, you can't
use bookmarks from different Recordset objects interchangeably, even if they
were created by using the same object or the same SQL statement.[..]"

Gruss
Henry

--
11. AEK Anmeldung unter http://donkarl.com/?AEK
Microsoft MVP Office Access
Keine E-Mails auf Postings in NGs. Danke.
Access FAQ www.donkarl.com

.



Relevant Pages

  • Re: Effects on RST in Calling Proc
    ... >> fail if the recordset itself remains valid. ... The bookmark property is available for the exact purpose ...
    (comp.databases.ms-access)
  • Re: bookmark
    ... MsgBox VarLesezeichen ... Wenn Du den Bookmark von rs verwenden willst, darfst Du das Form nicht ein eigenes Recordset anlegen lassen, auch wenn das SQL Statement idenitsch ist. ... Microsoft MVP Office Access ...
    (microsoft.public.de.access)
  • Re: Effects on RST in Calling Proc
    ... >>>FindFirst is a method, whereas a bookmark is a form of data. ... >> same recordset both times, and it has not been requeried. ... volatile piece of data except where it's the only option. ...
    (comp.databases.ms-access)
  • Re: Effects on RST in Calling Proc
    ... fail if the recordset itself remains valid. ... The bookmark property is available for the exact purpose of flagging and returning to a specific record in a recordset. ... FindFirst is a method, whereas a bookmark is a form of data. ... mention was made of a requery. ...
    (comp.databases.ms-access)
  • Re: Effects on RST in Calling Proc
    ... The bookmark property is available for the exact purpose ... >> of flagging and returning to a specific record in a recordset. ... >But we know that a bookmark is volatile data, ... >FindFirst is a method, whereas a bookmark is a form of data. ...
    (comp.databases.ms-access)