Hello! Again, just wanted to say thank you all for all the previous help I've received - it is much appreciated!
So, I've recently been trying to work on a Popup reminder for my Task Form - - the task form itself is actually bound to a user by a TempVars (they have to logon with their username and password before the form even opens) and it only shows the data that THEY have entered - - I recently watched the Popup Reminder and Popup Reminder Date videos and I have been able to test my popup reminder that "Tasks are due today" - - so in essence it works, but, in testing it, I found that it pops up this reminder on ALL the users task forms not just the one who's logged on at the time (does that make sense?)
I guess my question is, how do I bind the popup reminder to just that user? Do I have to put the TempVars in the Timer Event Code? And if that's the case, how and where could I do that? This is the only code I've got in the form's Timer Event code so far:
Dim ID as Long ID = Nz(DLookup("TaskID","TaskT","DateDue=#" & Date & "#"),0) If ID <> 0 Then DoCmd.OpenForm "NoticeF" End If
I'm just not sure where to put the TempVars to bind it to that user from there - or if that's even where I would put it? Thank you all again for any help you can give - IF you can! Lol, I always feel like I'm not explaining everything properly!!
ID = Nz(DLookup("TaskID","TaskT","DateDue=#" & Date & "# AND Username=""" & TempVars("X") & """"),0)
Samantha WatermanOP
@Reply 2 years ago
Thank you so much for all your help! I was finally able to become a member, yay! Lol
I used your adjustment just as you showed me but it still isn't working - - I keep getting Run Time Errors - - I have my Task Form bound to the user by the UserID, not the Username so I tried that as well but it still didn't work!
So I tried researching and googling what I could (still don't understand a lot about all this coding!) but the only tip I found was to use the criteria I'm after in a query and copy the SQL code it gives me from there and convert it to VBA - - that kind of fried my brain a little - - but what I understand from trying that method is that I think I need to have my DLookup criteria know that a user is already logged in, if that makes sense?
Criteria from the test query looked like this:
[Forms!]![TaskF]![UserID]
So I viewed the SQL from there and the criteria looked like this:
WHERE (((TaskT.DateDue)=Date() AND ((TaskT.UserID)=[Forms]![TaskF]![UserID]));
I'm not sure how to get that specific criteria into VBA or if that's actually the way to go with it, but any more help would be very much appreciated! Thanks again!!
Looks like you'd put that in the RecordSource property of whatever form you're opening.
SELECT * FROM MyTableT WHERE (((TaskT.DateDue)=Date() AND ((TaskT.UserID)=[Forms]![TaskF]![UserID]));
Samantha WatermanOP
@Reply 2 years ago
Samantha WatermanOP
@Reply 2 years ago
Awesome! Sorry, didn't know how to upload photos but I tested it and it worked! - - I've had to come back around to this problem because it's still not working for me, I know it's because of my limited knowledge of Access but this first photo that I uploaded is where I have my TempVars to bind my Task Form to it's user - - could I have done this wrong from the beginning? Because if the user doesn't log on correctly it used to give a debug error for that as well, but I tried the "On Error Resume Next" code and it worked to the point of logging them on to an "Unbound" Task Form if that makes sense - - so if I'm allowed to, the next couple of photos will be what I'm getting now when I'm trying this Pop Up Form!
Thank you!!! ^_^
Samantha WatermanOP
@Reply 2 years ago
Samantha WatermanOP
@Reply 2 years ago
Kevin Robertson
@Reply 2 years ago
I'm assuming UserID is a number, so you don't need the quotes.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Visitor Forum.