Results 1 to 4 of 4
  1. #1
    JackLeon is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2015
    Posts
    15

    Need to populate Combo box from values through query and a hard coded value at the same time.

    Currently I have a combo box in my access 2007 application which is drawing its value through a table using a SQL Query. I would also like it to show up a hard coded value in addition to the current list. Could anyone please help with the same.

  2. #2
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    you would need to create a union query - something like
    Code:
    SELECT myField
    FROM myTable
    UNION SELECT "HardCodedValue"
    FROM MyTable
    This assumes your original query returns only one column, if it returns more, you will need to add additional values of the same datatype

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by JackLeon View Post
    ... I would also like it to show up a hard coded value in addition to the current list...
    Not sure it is what you are looking for but you can include literal text within a query like this ...
    Code:
    SELECT QyeryName.FieldName, "Food For Thought" AS MyAlias
    FROM QyeryName;

  4. #4
    JackLeon is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2015
    Posts
    15
    Thanks guys.. query from Ajax was what I was looking for.. @Itsme.. actually I was trying to have the values in a single column.. your query would get it in another column.. may be I wasnt very clear with my query.. anyway, thanks for the help.

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

Similar Threads

  1. Time values in combo boxes.
    By BRZ-Ryan in forum Database Design
    Replies: 8
    Last Post: 12-29-2013, 09:48 AM
  2. Replies: 2
    Last Post: 01-08-2013, 08:49 AM
  3. Coded Loop v SQL Update Query Performance
    By bginhb in forum Programming
    Replies: 5
    Last Post: 01-21-2012, 03:02 PM
  4. Addition of similar coded items in query
    By shanky365 in forum Queries
    Replies: 1
    Last Post: 08-23-2011, 11:50 PM
  5. Having a hard time programmatically making reports
    By blacksaibot in forum Programming
    Replies: 6
    Last Post: 01-20-2010, 03:53 PM

Tags for this Thread

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