Form pop up and authorise (1 Viewer)

amd

New member
Local time
Today, 19:07
Joined
Dec 14, 2021
Messages
17
Hi,

I am a newbe to access and am trying to create a database, which is going well so far.

I would like to get a pop up box or form to appear depending on a value in a date field.

I have menaged to get the text boxes to change colour depending on the date, but not sure about getting a pop up to work.

I would also like the pop up to only close when a password is entered, ideally masking the password that is typed in. I presume this will need a control button to work.

Edit to question:

I would like the pop up or new form to appear when a record is opened and meets the criteria, e.g. if record 23 is selected and the date (date of birth) shows as being within the next few days, then a pop up form or message will appear, but only close down when a password is entered.

Apologies - forther edit after guidance

If the date is within 3 days, i would like the pop up to happen, but it needs to have a password entered to close it.


Can anyone offer any guidance please?

Thank you
 
Last edited:

oleronesoftwares

Passionate Learner
Local time
Today, 12:07
Joined
Sep 22, 2014
Messages
1,159
hi @amd

You will need a combination of if statement and an input box

e.g
if datefield= xxx then
Message = "Enter a value between 1 and 3" ' Set prompt.
Title = "InputBox Demo"

End if
 

amd

New member
Local time
Today, 19:07
Joined
Dec 14, 2021
Messages
17
hi @amd

You will need a combination of if statement and an input box

e.g
if datefield= xxx then
Message = "Enter a value between 1 and 3" ' Set prompt.
Title = "InputBox Demo"

End if
Thank you for your reply, I might sound a little dim, but how does this open a pop up message and where do I type it? Does it need to have something created first to do this?

again thank you
 

amd

New member
Local time
Today, 19:07
Joined
Dec 14, 2021
Messages
17
hi @amd

You will need a combination of if statement and an input box

e.g
if datefield= xxx then
Message = "Enter a value between 1 and 3" ' Set prompt.
Title = "InputBox Demo"

End if
I have slightly edited the question

I would like the pop up message or form to appear when a record is opened and meeds the criteria, e.g. if record 23 is selected and the date (date of birth) shows as being within the next few days, then a pop up form or message will appear, but only close down when a password is entered.
 

oleronesoftwares

Passionate Learner
Local time
Today, 12:07
Joined
Sep 22, 2014
Messages
1,159
Thank you for your reply, I might sound a little dim, but how does this open a pop up message and where do I type it? Does it need to have something created first to do this?
No you don't sound dim, ms access as an inputbox function, with parameters.

I have slightly edited the question

I would like the pop up message or form to appear when a record is opened and meeds the criteria, e.g. if record 23 is selected and the date (date of birth) shows as being within the next few days, then a pop up form or message will appear, but only close down when a password is entered.
Can you please sight an example with data, so we can all be clear what you want, e.g when you wrote "being with the next few days", that will be difficult to achieve, rather you have to specify how many days is "within the next few days"
 

bastanu

AWF VIP
Local time
Today, 12:07
Joined
Apr 13, 2010
Messages
1,401
The inputbox will not allow you to mask the password, you will need to add a module and use InputBoxDK, please see this thread for the code:
Or you can create your own modal pop-up form and set the Input Mask for the password textbox to "Password".

I think what you need is to use the form's Current event to check for the condition(s) and if satisfied then act on it (like open the password prompt).

Usually checking for an upcoming birthday involves stripping the birthdate field to extract the day and month and using DateSerial with the current year:
ThisYearBirthday: DateSerial(Year(Date()),Month([YourDOB_Field]),Day([YourDOB_Field]))

To check if it will be within the next x days:
Code:
If DateSerial(Year(Date()),Month([YourDOB_Field]),Day([YourDOB_Field])) - Date()<=5 Then 'birthday in the next 5 days

    Docmd.openform "popPassword",,,,,acDialog 'open as dialog so it cannot lose focus

End If

Cheers,
 

amd

New member
Local time
Today, 19:07
Joined
Dec 14, 2021
Messages
17
No you don't sound dim, ms access as an inputbox function, with parameters.


Can you please sight an example with data, so we can all be clear what you want, e.g when you wrote "being with the next few days", that will be difficult to achieve, rather you have to specify how many days is "within the next few days"
If the date is within 3 days, i would like the pop up to happen, but it needs to have a password entered/typed in to close the pop up down.
 

Users who are viewing this thread

Top Bottom