Results 1 to 1 of 1
  1. #1
    Mafukufuku is offline Novice
    Windows Vista Access 2003
    Join Date
    Feb 2010

    Getting a combobox to offer colums

    My problem might be solved by answering any of these questions:

    1: How does one get a combobox to display a choice from the columns of a query. So i will make a query with columns: "Sumof1", "Sumof2", "Sumof3" etc. The combobox hen displays "1" or "2" or "3" as a column to be chosen from that query. The result would have to be a textbox displaying the figure in the chosen column.

    Or 2: How can I get (in designview, please, still VBA illiterate) a query to wait for an input from a combobox and to recognize/use the input as a fieldname. Given the input from the combobox is named [Combo1] I tried to enter in field name:
    expr: [ "[combo1]"] and expr: ["combo1"], and [ &"[combo1]"&]

    The combobox source is a table with columns of userfriendly titels and a column with field names (boundcolumn). Should I change the expression or the way the fieldnames are in the table: enter them as [IdClient]![Dtblclient] with or wihtout ""'s, or [Dtblclient]![IdClient]

    I even tried: "Dtblclient]![IdClient" To be filled in: expr: ["[combo1]"]. Or do I use &'s here? Or is this impossible?

    can this be done? Or can question 1 be answered?

    3: getting the expression right for a textbox: =DCount("[qry1healthreport]![IdClient]";"[qry1healthreport]";"[Gender]=2 AND [qry1healthreport]![Age] Between [Forms]![frm1periodicalreport]![age6from] and [Forms]![frm1periodicalreport]![age6to] and [qry1healthreport]![VCT]='positiv'")

    Where [qry1healthreport]![Idclient] and [qry1healthreport]![VCT]='positiv' are variable by using a combobox or any other forms-possibility

    4: or a Dlookupfunction where the domain is a qry having all the sums in columns and where the expr. is based in any way on the input from a form to define the column where the Dlookupfunction is based on.: =Dlookup("[Combo1]";"[qry1sumsofallissues]"; etc etc]

    Any wokr around with extra querys to prepare data would of course also be very welcome.

    Some background info: I build a PDMS for a Homebased Care org. in rural KZN. They deal with clients who have issues: Legal issues, Health issues, Psychosocial issues etc. Dtblclient has gender, age, name, etc. dtblissuehealth has health issues: IdClient, VCT (positive/negative/Not Done), Shingles (y/n), disabililty (y/n) Dtblissuelegal has legal issues: Idclient, Id-book (y/n), CSG (y/n) etc. They need ot be able to select from a form: age, gender, visitnig period, issue to be counted for visited clients. The first things are easily done, but getting Acces to offer a choice of columns from where 1 can be Dcounted for yesses seems undoable.

    Thank you very much
    Last edited by Mafukufuku; 02-24-2010 at 04:04 AM. Reason: adding info

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

Similar Threads

  1. Replies: 0
    Last Post: 12-16-2009, 01:14 PM
  2. Combobox problem
    By newitsupport in forum Access
    Replies: 1
    Last Post: 09-26-2009, 01:03 PM
  3. ComboBox Row Source Value
    By mpbertha in forum Forms
    Replies: 1
    Last Post: 08-21-2009, 06:34 AM
  4. Replies: 2
    Last Post: 07-15-2009, 04:08 AM
  5. Inserting data in new colums
    By wasim_sono in forum Queries
    Replies: 2
    Last Post: 02-28-2006, 01:11 AM

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