Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 1st, 2006, 02:55 PM
Fin Fin is offline
Registered User
 
Join Date: Jan 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default vbYesNo Msgbox

I am trying to display a userform that I have designed when the Yes button is selected but I keep getting the error message 'Run-time error '438': Object doesn't support this property or method'.

He is my code:

Private Sub cbSuppliersInv_AfterUpdate()
If cbSuppliersInv.Enabled Then
If cbSuppliersInv.Value = True Then
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "Do you want to update supplier's invoice details?"
Style = vbYesNo + vbInformation + vbDefaultButton2
Title = "Please Confirm"
Help = "DEMO.HLP"
Ctxt = 1000
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then ' User chose Yes.
    frmSuppliersInv.Show
Else ' User chose No.
    MyString = "No" ' Perform some action.
End If
End If
End If
Worksheets("STERLING TRADED DETAILS").Select
End Sub

When I debug the code 'frmSuppliersInv.Show' is highlighted in yellow. Can anyone help me please?

 
Old January 4th, 2006, 05:21 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Hi Fin

I tried to recreate the error, but couldn't. The code is working fine.


Shasur

 
Old January 4th, 2006, 05:26 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Can you hit the function key F8 until you encounter the error, the line that fails is highlightedto be highlighted in yellow. VBA automatically goes to the userform.show line if an error like this occurs, however, this is not the failing line.

I am guessing you have some code embedded in the userform initialize event that is failing rather than the statement that is calling it.


Cheers

Matt






Similar Threads
Thread Thread Starter Forum Replies Last Post
Msgbox rwalker ASP.NET 1.x and 2.0 Application Design 28 March 20th, 2008 01:23 PM
Msgbox Help darrenb Access VBA 2 June 8th, 2007 12:53 AM
MsgBox prabodh_mishra Pro VB 6 1 December 29th, 2006 11:51 AM
msgbox Ramakrishna.G General .NET 3 September 14th, 2004 02:17 AM
help with Msgbox helmekki Excel VBA 2 June 25th, 2004 08:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.