20. maj 2004 - 01:58Der er
6 kommentarer og 1 løsning
Kan access huske sidst intastede værdi!
Jeg har en formular som egentlig er sat til dataindtasning - Jeg vil gerne have lavet det sådan, at formularen husker hvilket projektid som var det sidste jeg indtastede og starter op ved det igen efter dataindtasningen!! Hvordan klarer jeg dette??
There are a number of ways you could do this but a simple one would be to save it in a global variable. (In a module) Then in the AFTER UPDATE event of the form you can save the projekID in the global variable so that you can use it later.
In a module use something like this.
Public LastProjektID as Long
Then in the after update event
LastProjektID = Me.ProjektID
Then when yiou wnat to use it.
Me.ProjektID = LastProjektID 'You may need to test that it is set
En Public variable forsvinder vel, når man lukker databasen? Hvis man gemmer værdien i en tabel med en update query, når man lukker formularen, har man den også næste gang, man åbner databasen.
If you use a table then there is also the chance that you end up using the projektid from the last person who used the application, unless of course you also log the users ID.
Yes Thomas, things went a bit fast, I was on the way out of the door at the same time :o)
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.