cannot get list/combo box to work

C

cb

HI-
I'm having problems getting a list and/or combo box
selection to be passed to a query. If I type in Values
for either a list box or a combo box, it passes the
values to the query without any problem - but when I use
a table row - it will not recognise the value (it returns
a blank query.
I've checked that all the property options are the same.
I've set these up on the same form,(manual vrs. table
row) using the same values....

I just can't figure out what I'm doing wrong - or why it
won't work withthe table info. I could type it in, but
then the maintenance is more tedious. Any ideas that
might help me out?

Here is a copy of my SQL statement:
SELECT tblContacts.LastName, tblContacts.FirstName,
tblContacts.Address1, tblContacts.Address2,
tblContacts.Gender, tblGrpMembers.GroupName,
tblContacts.City, tblContacts.State, tblContacts.Zip,
tblContacts.Phone, tblContacts.FaxNumber,
tblContacts.Email
FROM tblContacts INNER JOIN tblGrpMembers ON
tblContacts.ContactID = tblGrpMembers.ContactID
WHERE (((tblGrpMembers.GroupName)=[Forms]!
[frmSelectGroup]![List7]))
ORDER BY tblContacts.LastName;

The only thing that changes between to 4 types is the
List7(manual) to List 20(from table row) or combo13(from
table row) or combo17(manual) - the 2 manuals work - the
2 tables do not!
ANY Ideas would be greatly appreciated!!!!
thanks - Cindy
 
N

Nikos Yannacopoulos

Cindy,

Have you checked that the list/combo returns the value that you think it
does (what you see) when populated from a table, rather than the table's PK
field? To verify, while the form is open and a valid selection is made, go
to VBA's immediate window (press Ctrl+G to get there) and type:

?)[Forms]! [frmSelectGroup]![List7]

to get the value returned. If what you get is not what you expected, check
out the list's rowsource and bound column property, and you'll find it
doesn't point to the desired column. You can either change the bound column
property to get what you want, or leave as is and retrieve the value like:

[Forms]! [frmSelectGroup]![List7].Volumn(1)

if what you want is the second column (first is index 0) etc.

HTH,
Nikos
 
C

cindy

Nikos - you rock!
Bound column was the problem - that's all it took...
Thank you SO much!!!
Cindy
-----Original Message-----
Cindy,

Have you checked that the list/combo returns the value that you think it
does (what you see) when populated from a table, rather than the table's PK
field? To verify, while the form is open and a valid selection is made, go
to VBA's immediate window (press Ctrl+G to get there) and type:

?)[Forms]! [frmSelectGroup]![List7]

to get the value returned. If what you get is not what you expected, check
out the list's rowsource and bound column property, and you'll find it
doesn't point to the desired column. You can either change the bound column
property to get what you want, or leave as is and retrieve the value like:

[Forms]! [frmSelectGroup]![List7].Volumn(1)

if what you want is the second column (first is index 0) etc.

HTH,
Nikos

HI-
I'm having problems getting a list and/or combo box
selection to be passed to a query. If I type in Values
for either a list box or a combo box, it passes the
values to the query without any problem - but when I use
a table row - it will not recognise the value (it returns
a blank query.
I've checked that all the property options are the same.
I've set these up on the same form,(manual vrs. table
row) using the same values....

I just can't figure out what I'm doing wrong - or why it
won't work withthe table info. I could type it in, but
then the maintenance is more tedious. Any ideas that
might help me out?

Here is a copy of my SQL statement:
SELECT tblContacts.LastName, tblContacts.FirstName,
tblContacts.Address1, tblContacts.Address2,
tblContacts.Gender, tblGrpMembers.GroupName,
tblContacts.City, tblContacts.State, tblContacts.Zip,
tblContacts.Phone, tblContacts.FaxNumber,
tblContacts.Email
FROM tblContacts INNER JOIN tblGrpMembers ON
tblContacts.ContactID = tblGrpMembers.ContactID
WHERE (((tblGrpMembers.GroupName)=[Forms]!
[frmSelectGroup]![List7]))
ORDER BY tblContacts.LastName;

The only thing that changes between to 4 types is the
List7(manual) to List 20(from table row) or combo13 (from
table row) or combo17(manual) - the 2 manuals work - the
2 tables do not!
ANY Ideas would be greatly appreciated!!!!
thanks - Cindy


.
 

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