De fleste virksomheder har efterhånden bevist, at AI virker.
Pilotprojekter leverer resultater. Medarbejdere bruger generative AI-værktøjer. Nye use cases dukker op på tværs af organisationen.
Du kan jo også lave en gruppeboks med alternativknapper. Hver knap returnerer en numerisk værdi til tabellen. Så i boksens OnClick event kan lave en Select Case, hvor Ramme1 er navnet på selve boksen:
Select Case Ramme1 Case Is 1 Me.felt1 = Date Case Is 2 Me.felt1 I Date + 2 Case Is 3 Me.felt1 = Date + 3 o.s.v End Select
Hej Niels - Godt at se du stadig er her et eller andet sted :o)
Ja - Der er mange måder at gøre tingene på. Men når spøgeren har formuleret sig som det er gjort forstår jeg det sådan, at der skal være flere valgmuligheder.
tni>It would be nice if you commented the answers and comments so far! They way I look at it, you should give us some more information. You say that you want the days date set in a field when you double click. THEN you say you want to add for example 6 days (på alle)!
På alle hvad?
If you want to add a variable number of days to the current date then you will also need some way of telling how many days you want to add and this could be for example a text field for entering a number or a combo conm where you could select from.
Then you could use (for example) Niels'function Function OmXDage() (I would remove Screen.ActiveControl = OmXDage from the function, then the fucntion can be used for other purposes.)
In the double click event (of some field) you would use
screen.activecontrol = OmXDage(me.FieldOrCombo)
where me.FieldOrCombo is either a text field or combo for entering/selecting the number of days.
Du bryder dig ikke om mine to sidste linjer: On Error Resume Next Screen.ActiveControl = OmXDage
Hvorfor ???? Det gør funktionen nem at bruge direkte i egenskabs arket - istedet for at oprette en VBA procedure for hvert element der skal bruge funktionen.
Hi Niels, well its just a matter of taste. I could imagine that this function could be used for a number of reasons, for example in a query, so it would be pointless having this in the function Screen.ActiveControl = OmXDage
when all that I want is to return the value. and I dont need to have a VBA procedure for each control, thats why I use
screen.activecontrol = OmXDage(me.FieldOrCombo)
If I need to set the current control and if it was in a query I could use
InAWeek:OmXDage(7)
or something like that.
I think it makes the function more flexible, but as I said its a matter of taste.
Det var den her jeg skulle bruge. Undskyld men jeg har ikke været ved pc på det sidste.
screen.activecontrol =date
mvh TNI
Synes godt om
Ny brugerNybegynder
Din løsning...
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.