Saturday 15 February 2014

Hidden Column in Listbox - Access 2007 -


I have a listback in Access 2007 which is linked to a table. That table has 4 columns but only those 2 columns are visible in my list. I use the loop command to identify the selected row but I can only see the contents of the visible column. When I look at it I display the visible column so that at least I can find out that I have the right line. I believe that the other 2 hidden columns are technically available to me because I mention them when I I look at the SQL associated with the listboxes. So I have 2 related questions:

  1. How can I confirm that those 2 hidden columns are actually available to me? And how can I reach them (I have to get the primary key related to the selected row.)

  2. If those hidden columns are available and I want them to show them to the listbox How can I do this?

    Learning access is now a weekend hobby. thank you in advanced. DevL

    You can show a list box that you want when you have chosen it in Design view Open the property sheet and select the Format tab. It says that column counting and column width where you can clarify. The Data tab on the asset sheet will allow you to select all your 4 fields to appear in the list box.

    Now to use the data in that listbox, you can use VBA for the click () and choose which columns you want to work with if you have that linkedbox The primary key is:

      Public sub_Listbox_Click () Set the dim myR as the record set myr = CurrentDb.OpenRecordset ("Table_Name", dbOpenDynaset) MyR.FindFirst ("[Primary_Key_Field] = '" & amp; Me._Listbox.Column (0) & "'")' You can now use that record with my R! [Field_Name] set myR = nothing ending sub    

No comments:

Post a Comment