Another cascade combo problem..

wasvsdal

New member
Local time
Today, 08:17
Joined
Nov 3, 2009
Messages
6
First and foremost, thank you for your time in reviewing my post and offering your advice. I have a database with the following schema:

tblPR:
PRID
Title
Amount
Status

tblProgram:
ProgramID
ProgramCode
ProgramTitle

tblFund:
FundCodeID
FundCode
FundTitle

There’s a many to many relationship between the previous two tables. Therefore, I setup a junction table.

tblPrgFund:
ProgramCode
ProgramTitle
FundCode
FundTitle
(These are lookup fields to their respective tables so I believe Access pulls their key as well which would be the ids)

Now main form is set to tblPR and sub form is set to tblPrgFund. There’s are two combo box in sub form for FundTitle and ProgramTitle respectively. Requirement is to filter ProgramTitle based upon FundTitle that is selected by user.

To do this I tried the following SQL command in VBA for gotfocus event of program title combo box. But it is only displaying ProgramID and not ProgramTitle. I don’t even think the ids are correct tbh.

“SELECT ProgramID, ProgramTitle FROM tblPrgFund WHERE FundCode = “ & Me.FundCode
 
Have you set the ColumnCount Property equal two, and also the ColumnWidths correct?



Yes those are set properly.


Sent from my iPhone using Tapatalk
 
Is FundCode a number field?
If it's a text field, you need text delimiters

What are the column width for your combo?
 
Is FundCode a number field?

If it's a text field, you need text delimiters



What are the column width for your combo?



It’s text in its primary table and lookup in junction table. Column width is 0,1


Sent from my iPhone using Tapatalk
 
Is FundCode a number field?

If it's a text field, you need text delimiters



What are the column width for your combo?



What do I need to do with text delimiters


Sent from my iPhone using Tapatalk
 
Text field delimiters would give:

Code:
SELECT ProgramID, ProgramTitle FROM tblPrgFund WHERE FundCode =[COLOR="Red"] '[/COLOR]“ & Me.FundCode[COLOR="red"] & "'"[/COLOR]

However, you've also said that you are using a table level lookup field which means what is stored isn't what is displayed. Therefore I can't advise on what you should use to get this working
Instead I recommend you NEVER use table level lookup fields as they cause all kinds of issues. Instead use queries to link tables as necessary

As the column width are 0,1 (cm?) the 2nd column should be displayed but not the first ... and it will be ... once you sort out the issues above
 

Users who are viewing this thread

Back
Top Bottom