07. maj 2002 - 14:49Der er
8 kommentarer og 1 løsning
Retuner en værdi
Jeg har en komboboks med nogle addesser. Skrives der i komboboksen og addressen ikke findes i forvejen åbnes der en form hvor man kan indtaste forskellige data. Jeg vil gerne vide hvordan jeg finder ud af om brugeren har trykket OK eller cancel efter indtastningen. Lige som man kan med en messagebox.
I dette særtema ser vi på, hvordan cloud og AI bliver fundamentet for virksomhedernes digitale forretning, og hvordan de nye muligheder for automatisering og forretningsværdi kan udnyttes uden at miste overblik, sikkerhed og menneskelig kontrol.
If you are trying to decide IF the data was actually accepted then somthing like this will do DoCmd.OpenForm "frmYourForm", , , , acFormAdd, acDialog, NewData If DLookup("SomeField", "SomeTable", "SomeField = '" & NewData & "'") Then
Response = acDataErrAdded End If
This will automatically update the combo with new data!
I will try to rephrase the question. I have 2 forms. In form 1 you can pick a customer in a combobox. If you enter a customer that doesent exist form 2 will open and you can enter all data about the mew customer. if the user press OK i want to receive OK in form 1 and if he press cancel i want to receive error
I DO understand that you want to do something IF the user pressed OK and something else IF the user pressed cancel!
IF you are NOT interested in updating the combo with the new data then you will have to set a GLOBAL variable which you can test the value of when form 2 gets closed.
The code I gave UPDATES the combo with the new data IF the user did actually enter the data, but it sounds as though you are not interested in doing that!
Im not sure what the newdata thing is, its empty all the time. acDataErrAdded is 2 on OK and on Cancel. so i dident receive any thing. Im just thinking about making a list count before and after form 2 then i will be able to see if there have been added some thing. But i still would like to know how to call a procedure and send/receive data while doing that.
No a module is a place for storing functions and variables.
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.