Greetings all,
I am attempting to make a form that will filter through several tables
that
(I believe) have refretial integrity. I am pulling data from several
tables into the form and i would like to eventually be able to filter
down through the
tables untill i can reach one unique record. I am creating a datbase
to keep track of registered accounts for a stae program. Each
account is registered into the program through a two diferent parties,
local and state wide. Accounts are unique. State wide parties are
unique. Local parties register accounts with either uniqie IDs or
aggregate Accounts under a unique ID. Each Local party may have one or
many names, which may or may not be unique for each account. Each
account registers information once a season (or more, sometimes people
resubmit becuase they want to make changes on their data). to enforce
refrential integrity, there is a multiple primary key index placed on
the accounts based on Dem_Y, Dem_S, Account, and Sub_date.
My tables look like this:
tblState;
StParty_ID (primary)
StParty_nm
....info
tblState_Local
LcParty_Id (primary)
StParty_ID (foreign key)
....info
tblLocal_Acct
LcParty_ID (foreign key)
LcParty_nm
Account (Primary key)
tblAccount_Dem_Y_S_Sub
Dem_y (multi- field index primary key)
Dem_S (multi- field index primary key)
Account (multi- field index primary key)
Sub_date (multi- field index primary key)
....unique data
The refrential integrity is working fine, i know this because there is
excellent heirarchy through tblState. i can "tree" down to the unique
data for an account perfectly. I would like to create a form, where i
can use combo boxes to navigate through the hierarchy as easy as i can
do in datasheet view of tblState. I am currently using one form with
several combo boxes which use the After update event to change the
rowsource of the next combo box that would correspond to the heirarchy
of the tables.
I can select a unique State party ID, and a label box will display the
State party's name. I have succesfully limited the rowsource of the
Local Party ID combo box so that it will only display the local IDs
that are registered through the selected State party_ID when i click
the drop down window. My problem is that i can not select one of the
Local ID's to continue my heirarchial form filtering. I can see them
in the dropdown window, but when i click on them i get an error sound
(Dong or Ding..whatever..). here is my code for changing the SQL
statement of the Rowsourse.
Private Sub cbxState_AfterUpdate()
Dim strSQL As String
strSQL = "Select LcParty_ID, StParty_Id "
strSQL = strSQL & "From tblState_Local "
strSQL = strSQL & "Where StParty_ID = " & Me!cbxState.Value
Me!cbxLocal.RowSource = strSQL
Me!cbxLocal.Requery
End Sub
I used this same format for changing the rowsource of the Accounts
combo box after updating the Local combo box.
I also used the Form wizard to select the specific fields from the
tables which would allow for the heirarchy to work ( so i think??)
Here is the record source for the form
SELECT tblState.StParty_nm, tblState_Local.StParty_ID,
tblLocal_Acct.Local_ID, tblLocal_Acct.LcParty_nm,
tblLocal_Acct.Account
FROM (tblState INNER JOIN tblState_Local ON tblState.StParty_ID =
tblState_Local.StParty_ID) INNER JOIN tblLocal_Acct ON
tblState_Local.LcParty_ID = tblLocal_Acct.LcParty_ID;
How do i get my combo boxes to work? should they be unbound? should
i be passing the combo boxes with multiple columns? any help would be
much appreciated. thank you in advance.