HOW CAN I DO THIS?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I HAVE AN Access projcet full with forms, i want a code that close all the
form that i opend

i tryed the End code & unload, but ithenk there is somthing missing

thanks for any help
 
you would need to be a bit more precise, but i think you are looking for a
quit operation. can you provide me more details?
 
Would Application.Quit work for you?

End Code & Form.Unload are VB6 commands. Access does not support them.


Chris Nebinger
 
HI
my project is a bout Pharmacy & contain more than 8 forms the baisc form
contain 3 command button 2 of them are concted with forms by siting there
propartis to open them, the last one is to Exit i also set itis propartis to
close but it's only colsing the the baisc form, i want this button to colse
all the forms
 
HANA,

If you mean you want to close all open forms, but leave the database
open, code something like this?...

Dim i As Integer
For i = Forms.Count - 1 To 0
DoCmd.Close acForm, Forms(i).Name
Next i
 
HI Steve
thank you for repling & sorry for beaing lait, i tried the code that you
gived me but is not working & put it here:
Private Sub Exit_Click()
On Error GoTo Err_Exit_Click
Dim i As Integer
For i = Forms.Count - 1 To 0
DoCmd.Close acForm, Forms(i).Name
Next i


DoCmd.Close

Exit_Exit_Click:
Exit Sub

Err_Exit_Click:
MsgBox Err.Description
Resume Exit_Exit_Click

End Sub
is that corrcet?
thanks for help:)
 
HANA,

Since we are counting backwards, try it by putting the Step argument in,
like this...

Dim i As Integer
For i = Forms.Count - 1 To 0 Step -1
DoCmd.Close acForm, Forms(i).Name
Next i
 
HI Mr.Steve
thank you for helping it worked for me i found that i missed(step-1)
i want to ask you one more Q?

it's normally in Access form we see navigations buttons in the end of the
form can we hide them? & make them spirited by putting them in box

thank you
 
Forms have a NavigationButton property you can set False (No) if you don't
want to see the navigation buttons.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top