Find/Filter with Text Input & Combo Select

  • Thread starter Quovardis via AccessMonster.com
  • Start date
Q

Quovardis via AccessMonster.com

Hi,

Im a complete noob when it comes to Access so please try to be a bit
understanding here :)
However I have searched on this forum and also looked at Alan Brownes site
but have either not unserstood or cant find anything related.

I have built a table with multiple fields & records on top of this I have a
form which displays all the Fields in different boxes.

Each record was given a unique ID (Primary Key) as there are multiple cases
of the same information.
For instance the real main reference is the "Site Name" but I have multiple
cases of the same Site Name because each Site name could have a 1 or more
"File names".

Confusing I know but what I have done is made a textbox or combo that will
filter based on the "Site Name" and then displays the whole of the
corresponding record in different Field boxes.

Now to the bit Im stuck on:

I want to be able to input a "Site Name" into a textbox then the combobox
will show me the different "File Names" associated with this "Site Name".

I want to then select each of the "File Names" in the combox box and in by
doing this it will update all of the field boxes from that record.


Hope someone can help with this... thanks
 
A

Arvin Meyer [MVP]

Quovardis via AccessMonster.com said:
Hi,

Im a complete noob when it comes to Access so please try to be a bit
understanding here :)
However I have searched on this forum and also looked at Alan Brownes site
but have either not unserstood or cant find anything related.

I have built a table with multiple fields & records on top of this I have
a
form which displays all the Fields in different boxes.

Each record was given a unique ID (Primary Key) as there are multiple
cases
of the same information.
For instance the real main reference is the "Site Name" but I have
multiple
cases of the same Site Name because each Site name could have a 1 or more
"File names".

Confusing I know but what I have done is made a textbox or combo that will
filter based on the "Site Name" and then displays the whole of the
corresponding record in different Field boxes.

Now to the bit Im stuck on:

I want to be able to input a "Site Name" into a textbox then the combobox
will show me the different "File Names" associated with this "Site Name".

That can be done with a filter
I want to then select each of the "File Names" in the combox box and in by
doing this it will update all of the field boxes from that record.

That can't since there is either many with the same name, or you've used the
DISTINCT keyword or grouping to limit the instances of that same site name.

Since you haven't told me if there is a single field in the table to be
updated, or multiple ones, I will assume multiples and tell you that you can
do it manually with an Update query, or programmatically with a recordset.
To use a recordset or a query, you'll need to tell Access the field's to be
updated and the values to use.
 
Q

Quovardis via AccessMonster.com

Arvin said:
[quoted text clipped - 23 lines]
I want to be able to input a "Site Name" into a textbox then the combobox
will show me the different "File Names" associated with this "Site Name".

That can be done with a filter
I want to then select each of the "File Names" in the combox box and in by
doing this it will update all of the field boxes from that record.

That can't since there is either many with the same name, or you've used the
DISTINCT keyword or grouping to limit the instances of that same site name.

Since you haven't told me if there is a single field in the table to be
updated, or multiple ones, I will assume multiples and tell you that you can
do it manually with an Update query, or programmatically with a recordset.
To use a recordset or a query, you'll need to tell Access the field's to be
updated and the values to use.


Hi Arvin,

Thanks for the reply but Im not sure ive given enough info to be honest.

Im only looking to show information, I dont need to be able to change or
update a field.

Some more info also:

Each record has around 15 Fields (including "Site Name" & "File Name".

The information in the other fields may be different if I choose the same
"Site Name" but with a different "File Name".

Example...

Site Name File Name Height Width Length
ABC 123 4 5 6
ABC xxx 7 8 9


I only want to display the other Fields based on the first 2 Filter.

I dont know if this helps any but I need some help building the code for the
Filter
 
R

Reggie

Set your second combobox recordsource to table/query. In the query add the
site name to the query. In the criteria under site name add something like
= Forms!YourFormName!YourFirstComboName

Then in the after update event of combobox1 requery combobox2:

Private Sub YourFirstComboName_AfterUpdate()
Me!YourSecondComboName.Requery
End Sub

--

Reggie
Quovardis via AccessMonster.com said:
Arvin said:
[quoted text clipped - 23 lines]
I want to be able to input a "Site Name" into a textbox then the
combobox
will show me the different "File Names" associated with this "Site
Name".

That can be done with a filter
I want to then select each of the "File Names" in the combox box and in
by
doing this it will update all of the field boxes from that record.

That can't since there is either many with the same name, or you've used
the
DISTINCT keyword or grouping to limit the instances of that same site
name.

Since you haven't told me if there is a single field in the table to be
updated, or multiple ones, I will assume multiples and tell you that you
can
do it manually with an Update query, or programmatically with a recordset.
To use a recordset or a query, you'll need to tell Access the field's to
be
updated and the values to use.


Hi Arvin,

Thanks for the reply but Im not sure ive given enough info to be honest.

Im only looking to show information, I dont need to be able to change or
update a field.

Some more info also:

Each record has around 15 Fields (including "Site Name" & "File Name".

The information in the other fields may be different if I choose the same
"Site Name" but with a different "File Name".

Example...

Site Name File Name Height Width Length
ABC 123 4 5 6
ABC xxx 7 8 9


I only want to display the other Fields based on the first 2 Filter.

I dont know if this helps any but I need some help building the code for
the
Filter
 
A

Arvin Meyer [MVP]

Quovardis via AccessMonster.com said:
Thanks for the reply but Im not sure ive given enough info to be honest.

Im only looking to show information, I dont need to be able to change or
update a field.

Some more info also:

Each record has around 15 Fields (including "Site Name" & "File Name".

The information in the other fields may be different if I choose the same
"Site Name" but with a different "File Name".

Example...

Site Name File Name Height Width Length
ABC 123 4 5 6
ABC xxx 7 8 9


I only want to display the other Fields based on the first 2 Filter.

I dont know if this helps any but I need some help building the code for
the
Filter

Here's an example of how to do it with list boxes and a form. In this case,
the first listbox filters the choices for the second, and the second chooses
the records to be displayed. You could use them independently and make both
choices, then select the records:

http://www.accessmvp.com/Arvin/Combo.zip
 

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