combo box query not working

G

Guest

The following in a combo box comes up blank.
1) The WHERE clause is not working
2) when I see a combo box that's blank, where do I look for the problem
SELECT DISTINCT [tblPerformance].[Version] FROM tblPerformance WHERE (([tblPerformance].[NameFull])=([Forms]![frmPlan]![cboPlanNameSelect]));
I was earlier advised to remove the square brackets around [Forms]
Access keeps putting them back

Also, I want certain data to be invisible until a name is selected. (AfterUpdate code makes them visible)
I've set 4 controls to invisible, AND SAVED, and the next time I bring up the form they are visible again
This has happened 4-5 times.
 
G

Graham Mandeno

Your advice was incorrect. The brackets around [Forms] are optional, and
the Access query grid will put them in anyway.

To debug your RowSource SQL, try copying the SQL string and pasting it into
the SQL window of a new query. Then run the query (with the form open and
something selected in cboPlanNameSelect) and see if it returns any records.

One possibility is that you have the wrong BoundColumn set in the first
combo. Try typing this in the VBA Debug window:
?Forms!frmPlan!cboPlanNameSelect <enter>
The value displayed should exactly match the value in the NameFull field of
the records you want to return.

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

DesertBear said:
The following in a combo box comes up blank.
1) The WHERE clause is not working.
2) when I see a combo box that's blank, where do I look for the problem?
SELECT DISTINCT [tblPerformance].[Version] FROM tblPerformance WHERE (([tblPerformance].[NameFull])=([Forms]![frmPlan]![cboPlanNameSelect]));
I was earlier advised to remove the square brackets around [Forms].
Access keeps putting them back.

Also, I want certain data to be invisible until a name is selected.
(AfterUpdate code makes them visible).
I've set 4 controls to invisible, AND SAVED, and the next time I bring up
the form they are visible again.
 

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