Results 1 to 4 of 4
  1. #1
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568

    How to use first column of combobox from table in query?

    Hi guys,

    I have table "tbl_MapaZus" with Combobox with PrzyczynaOutput field:

    Click image for larger version. 

Name:	tbl_MapaZus.png 
Views:	15 
Size:	22.6 KB 
ID:	31407


    "tbl_MapaZus" is mapping table.



    Now i am using this table to update data form Excel link table with using query:

    Click image for larger version. 

Name:	Query.jpg 
Views:	15 
Size:	55.0 KB 
ID:	31408

    If i want to update field "Cause" in "tb_Main" query like in attachment is working fine.
    Problem is that field Cause is a text string and i need to have number corresponded to it.

    So i would like to update also CAUSE_ID_FK in "tb_Main" using first column in combobox in "tbl_MapaZus".
    Please see the attachment - query here is not working:

    Click image for larger version. 

Name:	UpdateQuery.png 
Views:	15 
Size:	21.4 KB 
ID:	31409

    It is possible to refer to table combobox specific column using query ?

    Please help,
    Jacek Antek

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    No. Query will not recognize the Column property at all. Doesn't matter if reference is to lookup field or to combobox on form. Structure combobox so the ID is in first column and set ColumnWidths property to hide the ID column and set BoundColumn to 1. This will make value of the combobox the ID but display the descriptive field.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    Thank you very much June7!

    I did that so i am hiding this value within combobox.
    But after updating Cause field in "tb_Main" even if Cause field is a combobox only text is updated (visible column not hided).

    Maybe i should add third column to "tbl_MapaZUS" which will be automatically inputed when Cause ID will be choosen by User?
    After taht i can update "tb_Main" with my created column...?

    Best Wishes,
    Jacek

  4. #4
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    a sorry my mistake this is working !!!

    Thank you very much!
    Best Wishes,
    Jacek

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 03-02-2015, 06:05 PM
  2. Replies: 3
    Last Post: 03-02-2015, 09:50 AM
  3. Replies: 1
    Last Post: 01-16-2015, 09:28 AM
  4. Replies: 4
    Last Post: 09-04-2013, 06:40 AM
  5. Replies: 1
    Last Post: 08-09-2011, 06:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums