UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Msgbox, Access 2016    
 
   
mike60smart
post Mar 14 2019, 12:52 PM
Post#1


UtterAccess VIP
Posts: 13,070
Joined: 6-June 05
From: Dunbar,Scotland


Hi Everyone

I have an On Click Event to display Controls when needed which works just fine.

I now want to add a msgbox popup message with OK and Cancel Buttons in case the user click the Command Button in error

I tried the folloowing but it just displays the Controls as normal with no Popup Message?

Any help appreciated.

CODE
MsgBox("Are you sure you want to add Part Exchange Information?", vbOKCancel

End If

Dim ctrl As Control
For Each ctrl In Me.Controls
   If ctrl.Tag = "Marked" Then
     ctrl.Visible = True
   End If
Next

--------------------
Hope this helps?

Mike

Get happiness out of your work or you may never know what happiness is.

Go to the top of the page
 
DanielPineault
post Mar 14 2019, 01:16 PM
Post#2


UtterAccess VIP
Posts: 6,455
Joined: 30-June 11



Try

CODE
    Dim ctrl                  As Control

    If vbYes = MsgBox("Are you sure you want to add Part Exchange Information?", vbYesNo) Then
        For Each ctrl In Me.Controls
            If ctrl.Tag = "Marked" Then
                ctrl.Visible = True
            End If
        Next
    End If




--------------------
Daniel Pineault (2010-2018 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
projecttoday
post Mar 14 2019, 02:22 PM
Post#3


UtterAccess VIP
Posts: 10,635
Joined: 10-February 04
From: South Charleston, WV


There is no ")" in your Msgbox statement. Also, you need to test the result.

--------------------
Robert Crouser
Go to the top of the page
 
mike60smart
post Mar 14 2019, 03:33 PM
Post#4


UtterAccess VIP
Posts: 13,070
Joined: 6-June 05
From: Dunbar,Scotland


Hi Daniel

Many thanks works a treat

cheers.gif

--------------------
Hope this helps?

Mike

Get happiness out of your work or you may never know what happiness is.

Go to the top of the page
 
DanielPineault
post Mar 15 2019, 02:29 AM
Post#5


UtterAccess VIP
Posts: 6,455
Joined: 30-June 11



We're here to serve! thumbup.gif

--------------------
Daniel Pineault (2010-2018 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    20th March 2019 - 01:18 AM