A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

troubleshooting a combo-box used for a query



 
 
Thread Tools Display Modes
  #1  
Old April 20th, 2008, 12:19 AM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 1
Default troubleshooting a combo-box used for a query

I have a tiny bit of self taught knowledge using our Access 2003 but
I'm stumped on how to carry out some needed changes to our database.
I'll try not to be to wordy and I don't have Access here so some of my
explanations are from memory. These groups have been really helpful in
getting me to this point but now I can't locate the answers I need.

This database is a large list of addresses(513 records) we use to
setup invitations to special events. All the information is stored in
a single table "Mailing List". For each address entered, a senior
manager or VIP is listed with the record under field "Senior Manager".
For example:
Name / Address / Senior Manager
Client 1 / 123 Street / Harry
Client 2 / 345 Lane / Susan
Client 3 / 78 Road / Harry
Client 4 / 943 Way / CEO
The idea right now is to run a query to pull name/address records
using the senior manager name as criteria in the query design window.
This part works just fine but like any criteria the entry has to
exactly match something in the "Senior Manager" field. Ultimately the
query is used to feed data to a report.

What I would like to do is run a similar query, but now a combo box
would appear with all the manager names available for selection. I
felt that since the "Senior Manager" field has changing data the combo
box would work better instead of manually adding the manager name
values into the design properties. So RowSource was set to: Type/Query

Under Forms, I created the form "SelectSeniorManager" (using the
wizard). Took a couple of days to to get the source line right,
"SELECT DISTINCT [Mailing List].MailingListID, [Mailing List].[Senior
Manager]
FROM [Mailing List]
ORDER BY [Mailing List].LastName

Couldn't get the results right at first, it would seemingly ignore the
DISTINCT command and show each instance of manager name(513 records)
or the ID number(using variations of the above command).
Worked after these property values were set
Bound Column: (think it was 1)
Column Count: 2

Sometimes the combo box would be empty but I could tell it had found
the 31 results that were needed. The datasheet view would show my
desired results. It wasn't until I changed this:
Column Width: 0";1.1"
to
Column Width: 1.1";1.1"
that I got the box to show something correctly. I sort of get the
relationship with Bound, Column Count/Width but it just didn't work
until what I've listed above.

Here's where I'm stuck.
Now, the box is showing the answers I want, the mouse can highlight
them but when I click a selection it just sits there. I don't know the
right terms here but I guess its not taking the result. How can I fix
that? Using the wizard a few times to vary the answers on the last
question(something about storing values) but nothing ever changes.

Once I can actually make a selection should I have some "OK" button on
the form? Or would I make the selection, the value is stored and the
form would close?

Since I have a sort of working form "SelectSeniorManager". I built a
query with all the field names I want in the results (senior manager/
name/address/business title etc). In the criteria line of the "Senior
Manager" field I added Forms!SelectSeniorManager! with variations on
the end(since I don't know what I'm doing). When/If the query runs it
opens a "Enter Parameter Value" box, the words in the criteria line
are also showing in the box above the text entry field and I can type
in a manager name. So why wont it call up the form I've created
(unless its still busted in some way).

If you've managed to read this far (I thank you), could throw me some
suggestions? Thanks in Advance.
  #2  
Old April 21st, 2008, 08:46 PM posted to microsoft.public.access.forms
AKphidelt
external usenet poster
 
Posts: 591
Default troubleshooting a combo-box used for a query

Alright, not sure if I can completely help, but for starters it's good to see
someone actually work around themselves trying to get things to work.

As for helping, I can't really determine what you are exactly trying to do
here. If you are trying to select just 1 Senior Manager then you are going to
have to use the ID field, which you are currently bound to. The bound column
is the value of a combo box. So if you changed your Bound Column to 2, the
value would be the Senior Manager Name. This is very important if you want to
retrieve data based off a combobox

Next part is if you want the query to show all the names that match the
senior manager chosen in the combobox then in the criteria of the senior
managers you would put.

[Forms]![yourformwithcombobox]!yourcomboboxname

Remember to make sure the bound column is the name of the senior manager. As
long as the form is open the query would now show you all senior managers
with that match the name.

If you want to select just 1 record out of the query, then under the ID
Criteria you would do the exact same thing above except make sure your
combobox was bound to the ID column.

Now what you want to do with this data is up to you. If you can explain more
of what your end goal is I can help you on the next step of displaying this
data.

" wrote:

I have a tiny bit of self taught knowledge using our Access 2003 but
I'm stumped on how to carry out some needed changes to our database.
I'll try not to be to wordy and I don't have Access here so some of my
explanations are from memory. These groups have been really helpful in
getting me to this point but now I can't locate the answers I need.

This database is a large list of addresses(513 records) we use to
setup invitations to special events. All the information is stored in
a single table "Mailing List". For each address entered, a senior
manager or VIP is listed with the record under field "Senior Manager".
For example:
Name / Address / Senior Manager
Client 1 / 123 Street / Harry
Client 2 / 345 Lane / Susan
Client 3 / 78 Road / Harry
Client 4 / 943 Way / CEO
The idea right now is to run a query to pull name/address records
using the senior manager name as criteria in the query design window.
This part works just fine but like any criteria the entry has to
exactly match something in the "Senior Manager" field. Ultimately the
query is used to feed data to a report.

What I would like to do is run a similar query, but now a combo box
would appear with all the manager names available for selection. I
felt that since the "Senior Manager" field has changing data the combo
box would work better instead of manually adding the manager name
values into the design properties. So RowSource was set to: Type/Query

Under Forms, I created the form "SelectSeniorManager" (using the
wizard). Took a couple of days to to get the source line right,
"SELECT DISTINCT [Mailing List].MailingListID, [Mailing List].[Senior
Manager]
FROM [Mailing List]
ORDER BY [Mailing List].LastName

Couldn't get the results right at first, it would seemingly ignore the
DISTINCT command and show each instance of manager name(513 records)
or the ID number(using variations of the above command).
Worked after these property values were set
Bound Column: (think it was 1)
Column Count: 2

Sometimes the combo box would be empty but I could tell it had found
the 31 results that were needed. The datasheet view would show my
desired results. It wasn't until I changed this:
Column Width: 0";1.1"
to
Column Width: 1.1";1.1"
that I got the box to show something correctly. I sort of get the
relationship with Bound, Column Count/Width but it just didn't work
until what I've listed above.

Here's where I'm stuck.
Now, the box is showing the answers I want, the mouse can highlight
them but when I click a selection it just sits there. I don't know the
right terms here but I guess its not taking the result. How can I fix
that? Using the wizard a few times to vary the answers on the last
question(something about storing values) but nothing ever changes.

Once I can actually make a selection should I have some "OK" button on
the form? Or would I make the selection, the value is stored and the
form would close?

Since I have a sort of working form "SelectSeniorManager". I built a
query with all the field names I want in the results (senior manager/
name/address/business title etc). In the criteria line of the "Senior
Manager" field I added Forms!SelectSeniorManager! with variations on
the end(since I don't know what I'm doing). When/If the query runs it
opens a "Enter Parameter Value" box, the words in the criteria line
are also showing in the box above the text entry field and I can type
in a manager name. So why wont it call up the form I've created
(unless its still busted in some way).

If you've managed to read this far (I thank you), could throw me some
suggestions? Thanks in Advance.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:53 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.