Coding Issues Cont...

J

James

Hello I have 2 problems both related to the same form.

Right heres what I have got:

I have 3 forms and on main form.... The main form has a
combo box which has three values. Each value corrisponds
to one of the forms and pulls up the relevant form. Then
when you select another option from the combo box i9t
again pulls up the relevant form and hides the previous
form. This is all for a search form. I have created a
UNION query with help from some MVP's (Thanks again guys)
and I have based the main form on that UNION query. This
is because it joins 4 tables together. Ok now when I open
the main form I get a combo box at the top and two
buttons... One of which exits the form and the other which
searched the current form...

Now when I open one of the forms from the combo box all
the records seem to be displayed. This I dont want as its
a pointless excersise having to trall through all the
records which are displayed when I have the search
facility which is much more efficiant and less time
consuming. So my first question would be how do I stop all
the records from being shown?

The next one is within the coding for the seach facility...

I have the following:

FilterMe = "[id] > 0"

If chkcisco1 Then FilterMe = FilterMe & " AND [Forname]
= " & cbocisco1

DoCmd.ApplyFilter , FilterMe

End Sub

On the On Click command of the search records button.
Obviously I have more lines of this same code but with teh
fields names changed? Is this code right? if not how can I
correct it so that it searched the relevant records?

I have been given the following advice:

Use the Forms Where property i.e

DoCmd.Openform "SomeForm",,,,"ID=NULL"

I have a question about the above:

I am running the forms as sub forms how can I encorporate
thisinto this scenario? What happens is a user selects a
value from my combo box which then opens the relevant form
as a sub form. How can I do what is being asked with then
as a sub form?

Can anyone help with the above and the problem with why my
code dosent work when I try to use it to search for
records?

Many Thanks and your help will be appreciated

James
 

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