How to Open only one form at time in Access ??
hi all, :bigyello:
i have multiple form in access i am using access as a database and design form in access only so i have one main form which contain number of button (like a menu option's) from there i open one other form which also contain number of button for opening of the form i want to open one form at a time as follows ( following is no of button which open one form )
1) form main
Customer--
Other info--
Exit--
2) form Customer
Edit/Del Customer
Edit/ADD Customer
Return to Main form
3) from Other info
My Company info
Return to Main form
4) Exit button
when i am opening form main and click on "Customer button" it open form Customer and it remain form main also open is it posible that it open "form customer" in same windows ?? also when i am opening the Database at that time my "form main" should be open is it posible ?? how ??
pls help me regarding this ??
thanx in advance..
Re: How to Open only one form at time in Access ??
You can write the macro code to open and close the previous form. Then call it from the button click.
VB Code:
'Behind Main form:
Option Compare Database
Private Sub cmdCustome_Click()
DoCmd.OpenForm "Customer", acNormal, "", "", , acNormal 'Show desired form
DoCmd.Close acForm, "Menu" 'Close Main form
End Function
'Behind Customer Form:
Option Compare Database
Private Sub cmdBackNav_Click()
DoCmd.Close acForm, Me.Name 'Close current form
DoCmd.OpenForm "Main", acNormal 'Return to Main form
End Sub
Re: How to Open only one form at time in Access ??
hi RobDog,
thanx again for giving answer for my question as you tell me i need to write one micro first i had try to write the micro but it show me one window with name Action i select the Runcode action so i can try the code over there and run my code from there but not able to do this ... pls tell me how to do this or directly write the code on button click event ???.....pls help me regarding this ..
and also tell me how to open my main page when database is open first time ...
thanx in advance
Re: How to Open only one form at time in Access ??
Tools > Database Utilities > Switchboard Manager... This is where you can specify a startup form for when the db is opened.
If you open your main form in design view and click on the cliss button you will be able to view the clode for the form. This is where you will place similar code to what I had posted.
Re: How to Open only one form at time in Access ??
hay robDog,
is there any other way to set Default start page ??
because when i use Tools > Database Utilities > Switchboard Manager...
then it create one form Swithchboard and arrange all sequence of the form it's own ..
pls help me regarding this ...
if this one is only single way to craete it then can you pls tell me in detail way how to create Switchboard page or mane page...
thanx in advance..
Re: How to Open only one form at time in Access ??
Sorry, I meant Tools > Startup...
Its was very late last night :)