closing a subform inside the main form

Graphfixz

New member
Local time
Today, 00:04
Joined
Dec 5, 2003
Messages
5
Hi guys,

I need help with two things. Here is what I am doing. I have a Form that has a header, a body and a footer. The body consist of a subform where I open all the rest of the forms.

When the app starts the main form opens with a login form inside the subform. After user logs in I run some code to verify user and then use the following which doesn't work.

Code:
DoCmd.Close acForm, "Login", acSaveNo

The other thing I want to do is open another form inside the same submenu that the form Login was just closed. So I was tyrhing this:
Code:
DoCmd.OpenForm "logo"

and this didn't work either.

How can I close a subform using vba and then open a form inside the same submenu? Any ideas on how to fix this?

Thanks in advance.
 
You could place both forms on the main form in design view, and then trigger them with:

me.formname.visible = true
me.formname1.visible = false


This will just show the forms when you want to show them.

If one of the forms is a login screen for security you might need to password your vb code.

Just a suggestion.

If you want to use your code then you will need to reference the main form in your code e.g. me.mainform!subform

HTh

Andy
 

Users who are viewing this thread

Back
Top Bottom