By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,593 Members | 2,006 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,593 IT Pros & Developers. It's quick & easy.

how to close all forms in vb

100+
P: 284
is it possible to close all froms in visual basic project
except the form which we click to open

for example i we have a from newrecord when the user
click the menu newrecord only newreord form should be visible
and all other form if they are open are unloaded.
Dec 10 '07 #1
Share this Question
Share on Google+
4 Replies


debasisdas
Expert 5K+
P: 8,127
You can hide all other forms except the desired form.
Dec 10 '07 #2

100+
P: 284
my question is rather
if i open a form let say sales and entering sale then whil the sales form
is open i click on the form new record
now i want to automatically unload the sales form .
now then i click purchase form it will unload newrecord form
and so on

thus whenever ever i open any form it will unload the form which
is opened
i did not want to unload any form my typing name rather i want
to use somethig like this
insted of

Expand|Select|Wrap|Line Numbers
  1.  unload slaesfrm
or
Expand|Select|Wrap|Line Numbers
  1.  unload purchasefrm
i want to use

Expand|Select|Wrap|Line Numbers
  1.  unload "any form which is loaded"
hope you understand my question


You can hide all other forms except the desired form.
Dec 10 '07 #3

Ali Rizwan
100+
P: 927
Salam Muddassir Bhai

It can be doe but i don't think it all can be done by a single command.
Assign a number code to every form every time you opens new form like sales it checks the code and close that form.

You need to right these codes ones like unload sales or anyother form.
Write these in a module and then call at every form load event.

I think this will help you.
If you don't understand then tell me i ll demonstrate a sample.

And plz answer me here in thescripts not in yahoo for this post.
Waiting.

Allah Hafiz
>> Ali <<
Dec 10 '07 #4

100+
P: 284
asalam o alikum
ali,
i will try this if i had any further query i will mail you
thanks


Salam Muddassir Bhai

It can be doe but i don't think it all can be done by a single command.
Assign a number code to every form every time you opens new form like sales it checks the code and close that form.

You need to right these codes ones like unload sales or anyother form.
Write these in a module and then call at every form load event.

I think this will help you.
If you don't understand then tell me i ll demonstrate a sample.

And plz answer me here in thescripts not in yahoo for this post.
Waiting.

Allah Hafiz
>> Ali <<
Dec 11 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.