Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access ListBox Question rowsource, control source

Status
Not open for further replies.

MarkBiernacki

Programmer
Jul 15, 2001
1
US
Hello,
I have a Access 97 app, that I converted to 2000, then upsized to SQL 7. I have two tables. The First one Counties has fields County_ID, and CountyName. The second has demographic info in it. When I display a form with the demographic info, i want it to lookup the county name from the Counties table. I have a listbox and and want to have it populate it automatically. What I need to know is how to pass the county_ID to the sql statement that I have in the Row Source

select DISTINCTROW [Counties].[CountyName] from [Counties] where [Counties].[County_ID] = ??? Control Source ????

??? Control Source ??? is where I get stuck.

select DISTINCTROW [Counties].[CountyName] from [Counties] where [Counties].[County_ID] = !Current.County_ID!

Is there a var that I can use for control source. $CurrentRecord or something like that. This is driving me crazy. It seems so simple, yet I can not find any refference to it in any of my books. I am just not getting it. I know someone is going to say do it like this, and think i am a dummy. <grin>

Thanks in advance.

If you respond please give control source info and row source
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top