By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,806 Members | 1,380 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,806 IT Pros & Developers. It's quick & easy.

check box to select values only in selected table

P: 8
i have 2 list boxex which are bound together, if you select the ist list box it shows valeus in second table. below the list boxes i have a txt box and command button. Instead of going down each table they can just type the selection and press find it also has a find next butt that searches all the tables. I now want to create a check box that allows the users to view values only in the selected table can anyone assist.




Expand|Select|Wrap|Line Numbers
  1. Dim Sql   As String
  2.  
  3.  
  4. Sql = "SELECT caFieldKey, caTableLink, caTableName, [caFieldName_4], [Field Description] " & _
  5.       "FROM CATABLES INNER JOIN CAFIELDS ON " & _
  6.           "CATABLES.CATableKey = CAFIELDS.CATableLink " & _
  7.       "WHERE [CAFieldName_4] LIKE '*" & txtcaField & "*' AND " & _
  8.             "[Field Description] LIKE '*" & txtcaDescription & "*'"
  9. Set mRS = mDB.OpenRecordset(Sql, dbOpenSnapshot, dbFailOnError)
  10. If Not mRS.EOF Then
  11.   Me.lstcatable = mRS!CATableLink
  12.  lstcatable_AfterUpdate
  13.   Me.lstcafield = mRS!CAFieldKey
  14. End If
  15. End Sub
Mar 14 '07 #1
Share this Question
Share on Google+
1 Reply


100+
P: 1,646
You only need to alter your sql statement based on the checkbox being checked or not
Mar 15 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.