Access to SQL conversion problems : combo box

  • Thread starter Thread starter Tony Whitehouse
  • Start date Start date
T

Tony Whitehouse

Hi all,

I've created a combo box that selects a value from another combo
within the same form. Here is what I have prior to converting the
tables to sql:

(combo box: cboCategory)
SELECT tblFAQCategory.CategoryID, tblFAQCategory.CategoryTitle,
tblFAQCategory.SectionID
FROM tblFAQCategory
WHERE (((tblFAQCategory.SectionID)=Forms!frmT3FAQ!cboSection));


This is after :

(combo box: cboCategory)
SELECT dbo.tblFAQCategory.CategoryID,
dbo.tblFAQCategory.CategoryTitle, dbo.tblFAQCategory.SectionID
FROM dbo.tblFAQCategory
WHERE (((tblFAQCategory.SectionID) = [Forms] ! [frmT3FAQ] !
[cboSection]));


Both look similar to me (im new to this SQL stuff), however, the combo
box doesn't seem to want to pick up values from cboSection (I have
tried placing dbo. in front of tblFAQCategory in the WHERE statement)

I should note that [cboSection] is picking up values from a table
named [dbo.tblSection] which has is linked to [dbo.tblCategory]
through [SectionID]

If i have been vague then please forgive me!

Kind Regards


Tony Whitehouse
(e-mail address removed)
 
I suspect you would have been much better off using the SAME table names, as
now you are going to come across all kinds of little bugs here and there!


In the first sql, you have:
WHERE (((tblFAQCategory.SectionID)=Forms!frmT3FAQ!cboSection));

In the 2nd one, with the new table name, you did not change the table name:
WHERE (((tblFAQCategory.SectionID) = [Forms] ! [frmT3FAQ] !
[cboSection]));

Also, why all the extra spaces above? (is this just a cut and paste problem?

You should have just changed the table name to:
WHERE (((dbo.tblFAQCategory.SectionID)=Forms!frmT3FAQ!cboSection));

So, you forgot to change the table name in the above. The above should work.
 
Back
Top