PC Review


Reply
Thread Tools Rate Thread

Can you check a show modal property

 
 
jc
Guest
Posts: n/a
 
      29th Sep 2008
If you hit F1 on the ShowModal property in the Property box of a user form it
says it is read only.

In Sub UserForm_Activate the code:

If Me.ShowModal = False Then
MsgBox "Modeless"
End If

Causes Compile Error: Method ro data member not found

Is there code that can be used to check if a UserForm is Modal or Modeless?
--
CroceJC
 
Reply With Quote
 
 
 
 
dan dungan
Guest
Posts: n/a
 
      30th Sep 2008
Hi JC

I don't know, but now I'm curious.

I think to test for modeless, the form would have to be loaded.

But it seems that your code would determine how to load the form; so,
I don't understand how you wouldn't know if the form was modeless or
modal.

How would you use such a function if it were to exist?

Dan
 
Reply With Quote
 
jc
Guest
Posts: n/a
 
      30th Sep 2008
I want to use the same form in a case where I want to use it modal and
another case modeless. So when I instanciate it, the Userform_Initialize
procedure can test if modal or modeless and make some adjustments based on
this.
--
CroceJC


"dan dungan" wrote:

> Hi JC
>
> I don't know, but now I'm curious.
>
> I think to test for modeless, the form would have to be loaded.
>
> But it seems that your code would determine how to load the form; so,
> I don't understand how you wouldn't know if the form was modeless or
> modal.
>
> How would you use such a function if it were to exist?
>
> Dan
>

 
Reply With Quote
 
Gary Keramidas
Guest
Posts: n/a
 
      30th Sep 2008
just load it anyway you want

Sub test()
UserForm1.Show vbModal
End Sub

Sub test2()
UserForm1.Show vbModeless
End Sub


--


Gary

"jc" <(E-Mail Removed)> wrote in message
news:27325F99-B60C-4CCD-931B-(E-Mail Removed)...
>I want to use the same form in a case where I want to use it modal and
> another case modeless. So when I instanciate it, the Userform_Initialize
> procedure can test if modal or modeless and make some adjustments based on
> this.
> --
> CroceJC
>
>
> "dan dungan" wrote:
>
>> Hi JC
>>
>> I don't know, but now I'm curious.
>>
>> I think to test for modeless, the form would have to be loaded.
>>
>> But it seems that your code would determine how to load the form; so,
>> I don't understand how you wouldn't know if the form was modeless or
>> modal.
>>
>> How would you use such a function if it were to exist?
>>
>> Dan
>>



 
Reply With Quote
 
jc
Guest
Posts: n/a
 
      30th Sep 2008
I don't think you read my previous post close enough. I want to modify the
form when I use it modal so in initiation I need to check what type of show
it is.
--
CroceJC


"Gary Keramidas" wrote:

> just load it anyway you want
>
> Sub test()
> UserForm1.Show vbModal
> End Sub
>
> Sub test2()
> UserForm1.Show vbModeless
> End Sub
>
>
> --
>
>
> Gary
>
> "jc" <(E-Mail Removed)> wrote in message
> news:27325F99-B60C-4CCD-931B-(E-Mail Removed)...
> >I want to use the same form in a case where I want to use it modal and
> > another case modeless. So when I instanciate it, the Userform_Initialize
> > procedure can test if modal or modeless and make some adjustments based on
> > this.
> > --
> > CroceJC
> >
> >
> > "dan dungan" wrote:
> >
> >> Hi JC
> >>
> >> I don't know, but now I'm curious.
> >>
> >> I think to test for modeless, the form would have to be loaded.
> >>
> >> But it seems that your code would determine how to load the form; so,
> >> I don't understand how you wouldn't know if the form was modeless or
> >> modal.
> >>
> >> How would you use such a function if it were to exist?
> >>
> >> Dan
> >>

>
>
>

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      30th Sep 2008
Maybe you can add a public variable and make sure you change it before you show
the userform. Then check that variable's value when you need to.

Public UserFormMode as long

Sub test()
userformmode = vbmodal
UserForm1.Show userformmode
End Sub
Sub test2()
userformmode = vbmodeless
UserForm1.Show userformmode
End Sub

Then in your code...

if userformmode = vbmodal then
...


jc wrote:
>
> I don't think you read my previous post close enough. I want to modify the
> form when I use it modal so in initiation I need to check what type of show
> it is.
> --
> CroceJC
>
> "Gary Keramidas" wrote:
>
> > just load it anyway you want
> >
> > Sub test()
> > UserForm1.Show vbModal
> > End Sub
> >
> > Sub test2()
> > UserForm1.Show vbModeless
> > End Sub
> >
> >
> > --
> >
> >
> > Gary
> >
> > "jc" <(E-Mail Removed)> wrote in message
> > news:27325F99-B60C-4CCD-931B-(E-Mail Removed)...
> > >I want to use the same form in a case where I want to use it modal and
> > > another case modeless. So when I instanciate it, the Userform_Initialize
> > > procedure can test if modal or modeless and make some adjustments based on
> > > this.
> > > --
> > > CroceJC
> > >
> > >
> > > "dan dungan" wrote:
> > >
> > >> Hi JC
> > >>
> > >> I don't know, but now I'm curious.
> > >>
> > >> I think to test for modeless, the form would have to be loaded.
> > >>
> > >> But it seems that your code would determine how to load the form; so,
> > >> I don't understand how you wouldn't know if the form was modeless or
> > >> modal.
> > >>
> > >> How would you use such a function if it were to exist?
> > >>
> > >> Dan
> > >>

> >
> >
> >


--

Dave Peterson
 
Reply With Quote
 
jc
Guest
Posts: n/a
 
      6th Oct 2008
That would get the job done.
Thanks
--
CroceJC


"Dave Peterson" wrote:

> Maybe you can add a public variable and make sure you change it before you show
> the userform. Then check that variable's value when you need to.
>
> Public UserFormMode as long
>
> Sub test()
> userformmode = vbmodal
> UserForm1.Show userformmode
> End Sub
> Sub test2()
> userformmode = vbmodeless
> UserForm1.Show userformmode
> End Sub
>
> Then in your code...
>
> if userformmode = vbmodal then
> ...
>
>
> jc wrote:
> >
> > I don't think you read my previous post close enough. I want to modify the
> > form when I use it modal so in initiation I need to check what type of show
> > it is.
> > --
> > CroceJC
> >
> > "Gary Keramidas" wrote:
> >
> > > just load it anyway you want
> > >
> > > Sub test()
> > > UserForm1.Show vbModal
> > > End Sub
> > >
> > > Sub test2()
> > > UserForm1.Show vbModeless
> > > End Sub
> > >
> > >
> > > --
> > >
> > >
> > > Gary
> > >
> > > "jc" <(E-Mail Removed)> wrote in message
> > > news:27325F99-B60C-4CCD-931B-(E-Mail Removed)...
> > > >I want to use the same form in a case where I want to use it modal and
> > > > another case modeless. So when I instanciate it, the Userform_Initialize
> > > > procedure can test if modal or modeless and make some adjustments based on
> > > > this.
> > > > --
> > > > CroceJC
> > > >
> > > >
> > > > "dan dungan" wrote:
> > > >
> > > >> Hi JC
> > > >>
> > > >> I don't know, but now I'm curious.
> > > >>
> > > >> I think to test for modeless, the form would have to be loaded.
> > > >>
> > > >> But it seems that your code would determine how to load the form; so,
> > > >> I don't understand how you wouldn't know if the form was modeless or
> > > >> modal.
> > > >>
> > > >> How would you use such a function if it were to exist?
> > > >>
> > > >> Dan
> > > >>
> > >
> > >
> > >

>
> --
>
> Dave Peterson
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Modal property slickdock Microsoft Access Form Coding 7 22nd Jun 2009 11:26 PM
question of form modal property Jason Jiang Microsoft Access 2 28th Jun 2007 06:06 PM
Modal property Tom Microsoft Access Forms 3 17th Aug 2005 01:47 AM
Modal property help =?Utf-8?B?Um9nZXI=?= Microsoft Access Forms 3 10th May 2005 05:15 PM
Equivalent modal property for reports? Dan Microsoft Access Reports 1 18th Jul 2003 04:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:21 AM.