Pop-up message based on drop-down list (1 Viewer)

thecrunch

New member
Local time
Today, 17:11
Joined
Jun 21, 2019
Messages
7
Hello,

I have a 'check in/check out' split form for our company library. This form has a 'loan allowed' field with a Yes/No selection from a drop down list.

If a user selects an asset to check out with the loan allowed field = "No" , i would like to implement a pop-up message that states "warning! no loans allowed". With an ok only button.


I have attempted to create this with an if statement in the after update event of the loan allowed field. However, i have not been successful.


Any help is appreciated! Thanks :)
 

theDBguy

I’m here to help
Staff member
Local time
Today, 00:41
Joined
Oct 29, 2018
Messages
21,467
Hi. Welcome to the forum. Just curious first, what happens after the user clicks OK on the popup message? Are you expecting to cancel the selection then?
 

thecrunch

New member
Local time
Today, 17:11
Joined
Jun 21, 2019
Messages
7
Thank you for responding. I would like the pop-up message to close once the okay button is clicked. The item selection does not need to be cancelled.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 00:41
Joined
Oct 29, 2018
Messages
21,467
Thank you for responding. I would like the pop-up message to close once the okay button is clicked. The item selection does not need to be cancelled.

Okay, let’s see what you have in the Row Source of your dropdown.
 

isladogs

MVP / VIP
Local time
Today, 08:41
Joined
Jan 14, 2017
Messages
18,211
Please post the code you used unsuccessfully.
What happened when you used it? If an error, what was the error number/description?
 

thecrunch

New member
Local time
Today, 17:11
Joined
Jun 21, 2019
Messages
7
Hi theDBguy,

Apologies for not being clear in the original post.

It is a split form, where the user can use the datasheet portion of the form to locate a record, and use the form portion to view or edit the record. Once a record is located and selected, I would like an okay only pop-up box to occur if the selected record has a ‘No’ within the loan allowed field. The loan allowed field has been set up as a dropdown box with the row source "Yes";"No".

The popup box is simply a warning to the user, who may then click ‘okay’ as an acknowledgement of the warning. The pop-up box will close once ‘okay’ is clicked and the user may continue to edit the selected record or select a new one.
 

June7

AWF VIP
Local time
Yesterday, 23:41
Joined
Mar 9, 2014
Messages
5,468
Sounds like should have code in Current event.

Also sounds annoying.
 

ITguaranteed

New member
Local time
Today, 17:41
Joined
Jun 21, 2019
Messages
3
Call me crazy, but wouldn't it be better to have the list only show items the users can check out?
Or if it isn't a list then disable the check out button.
 
Last edited:

theDBguy

I’m here to help
Staff member
Local time
Today, 00:41
Joined
Oct 29, 2018
Messages
21,467
Hi theDBguy,

Apologies for not being clear in the original post.

It is a split form, where the user can use the datasheet portion of the form to locate a record, and use the form portion to view or edit the record. Once a record is located and selected, I would like an okay only pop-up box to occur if the selected record has a ‘No’ within the loan allowed field. The loan allowed field has been set up as a dropdown box with the row source "Yes";"No".

The popup box is simply a warning to the user, who may then click ‘okay’ as an acknowledgement of the warning. The pop-up box will close once ‘okay’ is clicked and the user may continue to edit the selected record or select a new one.
Hi. Thank you for the additional information. As June said, you'll need some code in the form's Current event. For example:
Code:
If Me.DropdownName = "No" Then
    MsgBox "Your message here...", vbInformation, "Warning!"
End If
 

Users who are viewing this thread

Top Bottom