13. januar 2003 - 14:42Der er
21 kommentarer og 1 løsning
sende popup meddelse når dato er = eller overskredet
Kan man i Access lave det sådanne at når en dato er = så kommer der en meddelses popup, uden at Access er åben ? Og ligeledes hvis den er overskredet. Hvis - hvordan ?
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.
You MUST have Access running. Then you can set a forms timer event to check if there any dates that are =. But then you have to get Access to be the Active window and this is where the problem starts! If it isnt the Active Window then you will not see the Dialog so all is lost!
Du skal starte din db, så kan du evt. minimere den formular, der skal give dig en MsgBox som POPUP. Sæt f.eks timeren til 1000, og ved timerudløb en hændelsesprocedüre:
Dim outobj As Outlook.Application Dim outappt As Outlook.AppointmentItem Set outobj = CreateObject("outlook.application") Set outappt = outobj.CreateItem(olAppointmentItem)
With outappt .start = Now() .End = DateAdd("nn", 5, Now()) 'add 5 minutes to date+time .subject = "THis is a test" .body = "This is the body" .location = "at home" .reminderMinutesbeforestart = 15 .ReminderSet = True .Save End With ' Release the Outlook object variable.
Thanx ;-) I´m not world champion in Access, so could you tell me how to do it. I have tryed to make a moduler (on danish :-) ) and then make a botton i a formular but it's not working. /Tommas
t-hviid>Forgot to tell you that you need a reference to Outlook. In code view you can do this in the Tools+References. Then find Outlook in the list. This may help some.
Tommas>I dont have an example, and I would have to use far too long to get a solution which might be acceptable. I can only suggest that you take a look around on the internet, as I just dont have the time right now, sorry!
It's ok Terry ;-). Have you made this your self or have you found it on the net. If it's from the net, I will be glad to know where. Thanx for your help!
I cant remember if I made it myslef or found it on the net at some time. It happended to be in among all the little bits and pieces I have. Here are a couple of links where you may find some help on AUTOMATING OUTLOOK and lots of other goodies too :o)
Så lykkedes det. Med god hjælp fra terry's links - den sidste :-) Her er hvad det endte med: Private Sub Kommandoknap23_Click() On Error GoTo Kommandoknap23_Err ' Save record first to be sure required fields are filled. DoCmd.RunCommand acCmdSaveRecord ' Exit the procedure if appointment has been added to Outlook. If Me!AddedToOutlook = True Then MsgBox "Der er indlagt påmindelse i Outlook!" Exit Sub ' Add a new appointment. Else Dim outobj As Outlook.Application Dim outappt As Outlook.AppointmentItem Set outobj = CreateObject("outlook.application") Set outappt = outobj.CreateItem(olAppointmentItem) With outappt .Start = Me!NaesteEftersynsDato & " " & Me!ApptTime .Duration = 30 .Subject = "Tjek paniklys" .Body = "Hele huset" .ReminderMinutesBeforeStart = 15 .ReminderSet = True
.Save End With End If ' Release the Outlook object variable. Set outobj = Nothing ' Set the AddedToOutlook flag, save the record, display a message. Me!AddedToOutlook = True DoCmd.RunCommand acCmdSaveRecord MsgBox "Påmindelse indlagt i Outlook" Exit Sub Kommandoknap23_Err: MsgBox "Error " & Err.Number & vbCrLf & Err.Description Exit Sub
Great to heat you got it working Tommas, and thanks for the points :o)
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.