VB Coding for using a second query in my Form

M

Melanie H.

I work for a manufacturing company which produces hollow metal doors and
frames. At their request, I created a database to access door and frame
cuts, we call these documents Preps.

I have created the database and search program with the invaluable help of
the Discussion Groups. Up to this point, I have receive an answer on all my
questions by reading the questions and comments posted by others.

My database contains 8 tables, 6 forms and 2 queries.

The form in question has two sections. In the header I have questions where
the user answers 10 basic questions: Department (doors, frames), Book (the
type of hardware being used), Manufacturer, Template, Template Date, Hardware
Side, Handing, Door Thickness, Degree of Opening and Comments. I have combo
boxes based off of the tables and a few boxes with just variables I just
entered to aid in populating these fields.

The detail section of my form is based on the [Prep_Entry_Query]. This
query is based on the Prep_Entry (table) my main table which is populated by
another form containing subforms. Anyways, the Prep_Entry_Query was created
as a means of alphabetizing the Prep Number and Drawing Number which are more
like a prep name, but they contains numbers.

The Prep Number and drawing number are the information they are looking for.
Everything to this point works great, but I have been asked to see if I can
make an enhancement to the program. You see, each view of the prep is stored
on a single page and is called a drawing and a prep may be associated with up
to ten drawings.

Sometimes they want to open a drawing (I have a hyperlink) and sometimes
they are just looking for the information of knowing a prep number.

Question: I need a button, that when pressed, to essentially condense the
list so that only the 1st drawing of each prep is shown. I have created a
[Prep_Hidden_Query], where I achieved the information I need by setting the
total for Drawing Number to First. I am not sure how to implement this info
into my form. I don't need another pop up form. I just need it to look like
the list was collapsed.

Can someone help me with the VB Code? I am not a VB expert, in fact the
more explicit the better. The first time I even opened Visual Basic was
three (3) weeks ago when I started writting this database program. If you
know a code that does not use the [Prep_Hidden_Query], I am good with that.
All suggestions appreciated.
 
M

Mike Painter

Melanie H. wrote:
Question: I need a button, that when pressed, to essentially
condense the list so that only the 1st drawing of each prep is shown.
I have created a [Prep_Hidden_Query], where I achieved the
information I need by setting the total for Drawing Number to First.
I am not sure how to implement this info into my form. I don't need
another pop up form. I just need it to look like the list was
collapsed.

Can someone help me with the VB Code? I am not a VB expert, in fact
the more explicit the better. The first time I even opened Visual
Basic was three (3) weeks ago when I started writting this database
program. If you know a code that does not use the
[Prep_Hidden_Query], I am good with that. All suggestions appreciated.

I'm not real clear on what you want but I'm guessing that you could use two
subforms, one that Always showed just the first drawing and the other that
showed all of them
Tyhe button would run
If Me.thisSumform.visible = True then
Me.thisSumform.visible = False
Me.thatSumform.visible = True
else
Me.thisSumform.visible = True
Me.thatSumform.visible = False
end if

That will work if I have my Trues and Falses right:)
 

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