My Assistant
![]() ![]() |
|
|
Feb 28 2006, 12:16 PM
Post
#1
|
|
|
New Member Posts: 11 |
working on cascading cbo looked at candace's examples but it seem to be haveing a had time getting it to work. I have a lot more cbo's. but here is the code that i used, i can't figure out what i'm doing wrong:
Private Sub Conforming_AfterUpdate() Dim strSQL As String Dim strSQLSF As String LoanSize = Null CH13 = Null Escrow = Null CreditScore = Null LTV = Null Purpose = Null PropertyType = Null CLTV = Null Occupancy = Null History = Null DTI = Null Documentation = Null Foreclosure = Null Seasoning = Null Assets = Null strSQL = "SELECT DISTINCT tbl_InvAdjustments.LoanSize FROM tbl_InvAdjustments " strSQL = strSQL & " WHERE tbl_InvAdjustments.Conforming = '" & Conforming & "'" strSQL = strSQL & " ORDER BY InvAdjustments.LoanSize;" LoanSize.RowSource = strSQL strSQLSF = "SELECT * FROM tbl_InvAdjustments " strSQLSF = strSQLSF & " WHERE tbl_InvAdjustments.Conforming = '" & Conforming & "'" End Sub
Attached File(s)
|
|
|
|
Feb 28 2006, 12:53 PM
Post
#2
|
|
|
UtterAccess Addict Posts: 275 From: Long Beach CA |
Part of the problem is that the field name for the query is the exact name as the cbo control. Here is a way you can check.
1. Put in this statement right before "Loansize.RowSource = strSQL": Debug.Print strSQL 2. Insert a breakpoint on the statement "Loansize.RowSource = strSQL". 3. Open the Immediate window. 4. Run the code by activating the Conforming cbo. 5. When the break occurs, look in the Immediate window. Copy the SQL statement. 6. On the database window, open a New Query. 7. On the "New Query" window, click "OK". 8. On the "Show Table" window, click "Close". 9. Right click on the upper pane and select "SQL View". 10. Paste the query that you copied from the Immediate Window. Now you can analyze the query that your code created. You will probably note that the datatype for "Conforming" does not match, but that's just a guess. |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 21st May 2013 - 12:45 PM |