Conditional Control Source

  • Thread starter Access+Goals=Suicide
  • Start date
A

Access+Goals=Suicide

Materials

Table: Book Field, Unit Field, Vocabulary Field
Form: Book Combo Box, Unit Combo Box, Vocabulary Field List

Goal

Return Vocabulary Field records to the Vocabulary Field List
based on Book, and Unit Value. e.g. (Book 1 (Unit 2 (Vocabulary)))

Problem

I cannot figure out how to return records to the Vocabulary Field List
with binding it to a specific query, or field.

Thanks!
 
L

Larry Linson

First, let me say that if you didn't intend your "handle" to be derogatory
to Access, it could certainly be viewed in that light. Second, going into a
newsgroup with a handle that says, "Your baby's ugly." is not the way to
make a good impression on people from whom you would like to get useful
answers.
Materials

Table: Book Field, Unit Field, Vocabulary Field
Form: Book Combo Box, Unit Combo Box, Vocabulary Field List

Goal

Return Vocabulary Field records to the Vocabulary Field List
based on Book, and Unit Value. e.g. (Book 1 (Unit 2 (Vocabulary)))

Problem

I cannot figure out how to return records to the Vocabulary Field List
with binding it to a specific query, or field.

Is your "Vocabulary Field List" actually a ListBox? If so, then you can set
its RowSource to an SQL statement that you construct:

Where:

VocField is the name of the Field that contains the Vocabulary Field and
tblBooks is the name of the table, cboBook is the ComboBox for books, and
cboUnit is the ComboBox for units that you describe, and both the Book Field
and the Unit Field are text or string values.

Dim db as DAO.Database
Dim tb as DAO.TableDef

strSQL = "SELECT VocabularyField FROM tblBooks WHERE [Book Field] = """ &
Me!cboBook & """ AND [Unit Field] = """ & Me!cboUnit & """:"
Me!lstVocabList.ControlSource = strSQL

Larry Linson
Microsoft Access MVP
 
Top