PC Review


Reply
Thread Tools Rate Thread

Help with "Form DoCmd.Open and DoCmd.Close

 
 
Ayo
Guest
Posts: n/a
 
      10th Dec 2007
The following two lines of code is not operating correctly.

Private Sub cmdChangeVendor1_Click()
DoCmd.Close acForm, "Invoice by Market Reviewer"
DoCmd.OpenForm "Selections Vendor and Reviewer", acNormal
End Sub

When I click on the cmdChangeVendor1 button, I expect the form "Invoice by
Market Reviewer" to close and the form "Selections Vendor and Reviewer" to
open. But that is not the result I get. The form "Invoice by Market Reviewer"
closes but that is about it. Nothing else opens. I have two forms that
behaves this way. I have checked and re-check the code many times to make
sure for spelling and syntax. Everything, as far as I can see, is correct.
Any help will be greatly appreciated. Thanks.
Ayo
 
Reply With Quote
 
 
 
 
BruceM
Guest
Posts: n/a
 
      10th Dec 2007
If you comment out (place an apostrophe in front of) the DoCmd.Close line,
does the Selections Vendor and Reviewer form open as it should?

"Ayo" <(E-Mail Removed)> wrote in message
news:F5F601DA-19EE-4738-A765-(E-Mail Removed)...
> The following two lines of code is not operating correctly.
>
> Private Sub cmdChangeVendor1_Click()
> DoCmd.Close acForm, "Invoice by Market Reviewer"
> DoCmd.OpenForm "Selections Vendor and Reviewer", acNormal
> End Sub
>
> When I click on the cmdChangeVendor1 button, I expect the form "Invoice by
> Market Reviewer" to close and the form "Selections Vendor and Reviewer" to
> open. But that is not the result I get. The form "Invoice by Market
> Reviewer"
> closes but that is about it. Nothing else opens. I have two forms that
> behaves this way. I have checked and re-check the code many times to make
> sure for spelling and syntax. Everything, as far as I can see, is correct.
> Any help will be greatly appreciated. Thanks.
> Ayo



 
Reply With Quote
 
 
 
 
Dale Fye
Guest
Posts: n/a
 
      10th Dec 2007
Are you certain that you have the spelling of the form name exactly correct
(I cannot count the number of times that I have made that mistake). Check
that you don't have two spaces right next to one another either in the form
name or in the OpenForm statement. This is one of the reasons I never
include spaces in my object names.

--
Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



"Ayo" wrote:

> The following two lines of code is not operating correctly.
>
> Private Sub cmdChangeVendor1_Click()
> DoCmd.Close acForm, "Invoice by Market Reviewer"
> DoCmd.OpenForm "Selections Vendor and Reviewer", acNormal
> End Sub
>
> When I click on the cmdChangeVendor1 button, I expect the form "Invoice by
> Market Reviewer" to close and the form "Selections Vendor and Reviewer" to
> open. But that is not the result I get. The form "Invoice by Market Reviewer"
> closes but that is about it. Nothing else opens. I have two forms that
> behaves this way. I have checked and re-check the code many times to make
> sure for spelling and syntax. Everything, as far as I can see, is correct.
> Any help will be greatly appreciated. Thanks.
> Ayo

 
Reply With Quote
 
Ayo
Guest
Posts: n/a
 
      10th Dec 2007
The same thing happened. It just closed everything and nothing opened. This
is very strange.

"BruceM" wrote:

> If you comment out (place an apostrophe in front of) the DoCmd.Close line,
> does the Selections Vendor and Reviewer form open as it should?
>
> "Ayo" <(E-Mail Removed)> wrote in message
> news:F5F601DA-19EE-4738-A765-(E-Mail Removed)...
> > The following two lines of code is not operating correctly.
> >
> > Private Sub cmdChangeVendor1_Click()
> > DoCmd.Close acForm, "Invoice by Market Reviewer"
> > DoCmd.OpenForm "Selections Vendor and Reviewer", acNormal
> > End Sub
> >
> > When I click on the cmdChangeVendor1 button, I expect the form "Invoice by
> > Market Reviewer" to close and the form "Selections Vendor and Reviewer" to
> > open. But that is not the result I get. The form "Invoice by Market
> > Reviewer"
> > closes but that is about it. Nothing else opens. I have two forms that
> > behaves this way. I have checked and re-check the code many times to make
> > sure for spelling and syntax. Everything, as far as I can see, is correct.
> > Any help will be greatly appreciated. Thanks.
> > Ayo

>
>
>

 
Reply With Quote
 
Ayo
Guest
Posts: n/a
 
      10th Dec 2007
That is not the issue. That was my first reaction. But I have gone through
it, checked and re-checked and I keep getting the same result.

"Dale Fye" wrote:

> Are you certain that you have the spelling of the form name exactly correct
> (I cannot count the number of times that I have made that mistake). Check
> that you don't have two spaces right next to one another either in the form
> name or in the OpenForm statement. This is one of the reasons I never
> include spaces in my object names.
>
> --
> Don''t forget to rate the post if it was helpful!
>
> email address is invalid
> Please reply to newsgroup only.
>
>
>
> "Ayo" wrote:
>
> > The following two lines of code is not operating correctly.
> >
> > Private Sub cmdChangeVendor1_Click()
> > DoCmd.Close acForm, "Invoice by Market Reviewer"
> > DoCmd.OpenForm "Selections Vendor and Reviewer", acNormal
> > End Sub
> >
> > When I click on the cmdChangeVendor1 button, I expect the form "Invoice by
> > Market Reviewer" to close and the form "Selections Vendor and Reviewer" to
> > open. But that is not the result I get. The form "Invoice by Market Reviewer"
> > closes but that is about it. Nothing else opens. I have two forms that
> > behaves this way. I have checked and re-check the code many times to make
> > sure for spelling and syntax. Everything, as far as I can see, is correct.
> > Any help will be greatly appreciated. Thanks.
> > Ayo

 
Reply With Quote
 
Ron2006
Guest
Posts: n/a
 
      10th Dec 2007
What is the name of the form you are sitting in when you press the
button.?

If it is "Invoice by Market Reviewer" then the second command is NOT
executed because the form has closed.

reverse the order..


Ron
 
Reply With Quote
 
Bob Quintal
Guest
Posts: n/a
 
      10th Dec 2007
Ron2006 <(E-Mail Removed)> wrote in
news:3727c061-078d-4bd1-9ac6-(E-Mail Removed)
:

> What is the name of the form you are sitting in when you press the
> button.?
>
> If it is "Invoice by Market Reviewer" then the second command is
> NOT executed because the form has closed.
>
> reverse the order..
>
>
> Ron
>


Not true. The code will continue, at least in Access <= 2003.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

 
Reply With Quote
 
BruceM
Guest
Posts: n/a
 
      11th Dec 2007
Can you open Selections Vendor and Reviewer from the database window (that
is, by double-clicking the form's icon)?

"Ayo" <(E-Mail Removed)> wrote in message
news:FBE5D2CA-7692-4E92-8F7A-(E-Mail Removed)...
> The same thing happened. It just closed everything and nothing opened.
> This
> is very strange.
>
> "BruceM" wrote:
>
>> If you comment out (place an apostrophe in front of) the DoCmd.Close
>> line,
>> does the Selections Vendor and Reviewer form open as it should?
>>
>> "Ayo" <(E-Mail Removed)> wrote in message
>> news:F5F601DA-19EE-4738-A765-(E-Mail Removed)...
>> > The following two lines of code is not operating correctly.
>> >
>> > Private Sub cmdChangeVendor1_Click()
>> > DoCmd.Close acForm, "Invoice by Market Reviewer"
>> > DoCmd.OpenForm "Selections Vendor and Reviewer", acNormal
>> > End Sub
>> >
>> > When I click on the cmdChangeVendor1 button, I expect the form "Invoice
>> > by
>> > Market Reviewer" to close and the form "Selections Vendor and Reviewer"
>> > to
>> > open. But that is not the result I get. The form "Invoice by Market
>> > Reviewer"
>> > closes but that is about it. Nothing else opens. I have two forms that
>> > behaves this way. I have checked and re-check the code many times to
>> > make
>> > sure for spelling and syntax. Everything, as far as I can see, is
>> > correct.
>> > Any help will be greatly appreciated. Thanks.
>> > Ayo

>>
>>
>>



 
Reply With Quote
 
Ron2006
Guest
Posts: n/a
 
      11th Dec 2007
On Dec 11, 5:11 am, "BruceM" <bam...@yawhodotcalm.not> wrote:
> Can you open Selections Vendor and Reviewer from the database window (that
> is, by double-clicking the form's icon)?
>
> "Ayo" <A...@discussions.microsoft.com> wrote in message
>
> news:FBE5D2CA-7692-4E92-8F7A-(E-Mail Removed)...
>
>
>
> > The same thing happened. It just closed everything and nothing opened.
> > This
> > is very strange.

>
> > "BruceM" wrote:

>
> >> If you comment out (place an apostrophe in front of) the DoCmd.Close
> >> line,
> >> does the Selections Vendor and Reviewer form open as it should?

>
> >> "Ayo" <A...@discussions.microsoft.com> wrote in message
> >>news:F5F601DA-19EE-4738-A765-(E-Mail Removed)...
> >> > The following two lines of code is not operating correctly.

>
> >> > Private Sub cmdChangeVendor1_Click()
> >> > DoCmd.Close acForm, "Invoice by Market Reviewer"
> >> > DoCmd.OpenForm "Selections Vendor and Reviewer", acNormal
> >> > End Sub

>
> >> > When I click on the cmdChangeVendor1 button, I expect the form "Invoice
> >> > by
> >> > Market Reviewer" to close and the form "Selections Vendor and Reviewer"
> >> > to
> >> > open. But that is not the result I get. The form "Invoice by Market
> >> > Reviewer"
> >> > closes but that is about it. Nothing else opens. I have two forms that
> >> > behaves this way. I have checked and re-check the code many times to
> >> > make
> >> > sure for spelling and syntax. Everything, as far as I can see, is
> >> > correct.
> >> > Any help will be greatly appreciated. Thanks.
> >> > Ayo- Hide quoted text -

>
> - Show quoted text -


I humbly withdraw my comment. Bob is correct.

If you simply open the other form with the button does it work?
The prior form does NOT have to be closed to open another form.

Ron
 
Reply With Quote
 
BruceM
Guest
Posts: n/a
 
      11th Dec 2007
So did you solve this or not? I can't tell.

"Ron2006" <(E-Mail Removed)> wrote in message
news:040b9d0b-1126-4eb5-af69-(E-Mail Removed)...
> On Dec 11, 5:11 am, "BruceM" <bam...@yawhodotcalm.not> wrote:
>> Can you open Selections Vendor and Reviewer from the database window
>> (that
>> is, by double-clicking the form's icon)?
>>
>> "Ayo" <A...@discussions.microsoft.com> wrote in message
>>
>> news:FBE5D2CA-7692-4E92-8F7A-(E-Mail Removed)...
>>
>>
>>
>> > The same thing happened. It just closed everything and nothing opened.
>> > This
>> > is very strange.

>>
>> > "BruceM" wrote:

>>
>> >> If you comment out (place an apostrophe in front of) the DoCmd.Close
>> >> line,
>> >> does the Selections Vendor and Reviewer form open as it should?

>>
>> >> "Ayo" <A...@discussions.microsoft.com> wrote in message
>> >>news:F5F601DA-19EE-4738-A765-(E-Mail Removed)...
>> >> > The following two lines of code is not operating correctly.

>>
>> >> > Private Sub cmdChangeVendor1_Click()
>> >> > DoCmd.Close acForm, "Invoice by Market Reviewer"
>> >> > DoCmd.OpenForm "Selections Vendor and Reviewer", acNormal
>> >> > End Sub

>>
>> >> > When I click on the cmdChangeVendor1 button, I expect the form
>> >> > "Invoice
>> >> > by
>> >> > Market Reviewer" to close and the form "Selections Vendor and
>> >> > Reviewer"
>> >> > to
>> >> > open. But that is not the result I get. The form "Invoice by Market
>> >> > Reviewer"
>> >> > closes but that is about it. Nothing else opens. I have two forms
>> >> > that
>> >> > behaves this way. I have checked and re-check the code many times to
>> >> > make
>> >> > sure for spelling and syntax. Everything, as far as I can see, is
>> >> > correct.
>> >> > Any help will be greatly appreciated. Thanks.
>> >> > Ayo- Hide quoted text -

>>
>> - Show quoted text -

>
> I humbly withdraw my comment. Bob is correct.
>
> If you simply open the other form with the button does it work?
> The prior form does NOT have to be closed to open another form.
>
> Ron



 
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
help help help help help help win98 to xp professional =?Utf-8?B?JiZMRUUmJg==?= Windows XP Help 2 23rd Oct 2005 04:00 PM
HELP NEEDED FAST!!! HELP HELP HELP HELP HELP HELP FAST HELP NEEDED Jonathan Windows XP General 10 13th Jan 2005 03:22 AM
HELP HELP HELP HELP HELP HELP =?Utf-8?B?U2FuYXRhcml1bV83?= Windows XP General 2 25th Sep 2004 04:00 PM
HELP HELP HELP HELP HELP HELP =?Utf-8?B?U2FuYXRhcml1bV83?= Windows XP General 1 25th Sep 2004 07:54 AM
Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! -$- Windows XP Internet Explorer 2 21st Dec 2003 11:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:32 AM.