hidden forms

L

lez

Hi Guys,

I have created a 'Main Menu' style form that has a section which has 3 forms
in a hidden state. On this form I have an 'option group' which allows the
user to select the form they want to view, show hide is working fine.

One of my forms is a search form, that allows users to enter either
lastname, tel or email to search for a client.

The problem I am having is that when I run the search, the parameter boxes
keep showing looking for a value, then opens with all clients and ingnores
the filter.

If however, the form is just opened as a stand alone form thwe search result
works fine. I gather it has something to do with being nested in the 'main
menu' but not sure how I can alter it.

I would also like to have the result form again nested in the main menu, but
that form requires values before it can display and if I just add the form,
although hidden when the main menu opens the parameter boxes request
values,so if anyone knows how I could add this to the form and only respond
once a search request is submitted it would be helpful.

Finally, as this is going to be connected to a SQL server, if anyone knows
of a way to have the forms hidden and only populate with data once they have
been selected from the option box, that to would be very helpful.

Thank you

Many thanks
 
N

Noëlla Gabriël

Hi Lez,

it's a bit difficult to advise you about the subforms, not knowing what
their data sources are, or how your code is build.
I can help you with the final question though: just give the form as initial
datasource something like: select * from myTable where 1=0". This will result
in an emty recordset. Once the form has been selected in the option group
you reset the datasource with the real where crits.
 
D

Dirk Goldgar

lez said:
Hi Guys,

I have created a 'Main Menu' style form that has a section which has 3
forms in a hidden state. On this form I have an 'option group' which
allows the user to select the form they want to view, show hide is working
fine.

One of my forms is a search form, that allows users to enter either
lastname, tel or email to search for a client.

The problem I am having is that when I run the search, the parameter boxes
keep showing looking for a value, then opens with all clients and ingnores
the filter.

If however, the form is just opened as a stand alone form thwe search
result works fine. I gather it has something to do with being nested in
the 'main menu' but not sure how I can alter it.

I would also like to have the result form again nested in the main menu,
but that form requires values before it can display and if I just add the
form, although hidden when the main menu opens the parameter boxes request
values,so if anyone knows how I could add this to the form and only
respond once a search request is submitted it would be helpful.

From the sound of it, the problems you're having are coming from the fact
that subforms open before their parent forms. Therefore, the subforms are
querying their recordsources, which have references to the controls on the
main form, before that form is open. This results in the parameter prompts
you see.

To get around this problem, you could do one of two things. Either change
the subforms to have blank recordsources initially, and then assign those
recordsources in some event of the main form -- maybe the one where you make
a particular subform visible -- or else leave the SourceObject property of
each subform control (on the main form) blank, and then assign that property
only when you want to make the subform visible.
Finally, as this is going to be connected to a SQL server, if anyone knows
of a way to have the forms hidden and only populate with data once they
have been selected from the option box, that to would be very helpful.

Either one of the above approaches ought to do that.
 
L

lez

Hi Noelle,

Many thanks for that, can you explain a little more of whjat you are
suggesting, I understand what you are saying, just do not understand how I
would apply it to my forms.

The from the answer by Dirk, also seems to suggest the same solution to this
problem.

Do you suggest that I have enter the code on the button 'onclick' event to
show the form, or within the query for thr form?

Many thanks
Lez
 

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

Top