Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trouble with Findrecord
Message
De
10/07/2013 12:18:14
 
 
À
10/07/2013 12:14:36
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01578102
Message ID:
01578120
Vues:
28
I changed the code to this, but the selected record is not shown when the form is loaded.

Sub Get_ID()
Dim nKey
Dim db As Database, rst As Recordset, rstValid_Numbers As Recordset
Set db = CurrentDb
Application.SetOption "Confirm Action Queries", 0
Application.SetOption "Confirm Document Deletions", 0
Application.SetOption "Confirm Record Changes", 0
Set rst = db.OpenRecordset("Select Last_id from ID_Lookup;")
nKey = rst.Fields("last_id")
Set rstValid_Numbers = db.OpenRecordset("Valid_Numbers")
rstValid_Numbers.Index = "ID1"
rstValid_Numbers.Seek "=", nKey
Me.Refresh
End Sub


>Looks like you have already filtered the result to a single id, so why is the findfirst needed at all?
>unless in reading this wrong you are going to get a single record if the id exists and nothing if it doesnt.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform