Results 1 to 3 of 3
  1. #1
    focosi is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    97

    use parameter in field name of select query


    Let's assume I have Form1 with "hello" in TxtField1.
    Now I have a select query with a field named "ID".
    Is it possible to rename "ID" as parameter "hello" ? I have tried inputting in SQL "OriginalQueryFieldName AS [Forms]![Form1]![TxtField1]" but it is not accepted.

    Another point is : can I use the parameter "hello" in the query caption ?

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Are you trying to use a field value on your form to filter a query?

    "SELECT a,b,c from MyTable WHERE myField = '" & [Forms]![Form1]![TxtField1] & "'"

  3. #3
    focosi is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    97
    No, I am using a field value to name the field name (very top row) or the caption (window name) in a query. Is it possible ??

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

Similar Threads

  1. Parameter query on memo field?
    By UnfinishedStory in forum Queries
    Replies: 1
    Last Post: 10-27-2011, 11:05 AM
  2. Parameter Query on a calculated field
    By l3111 in forum Queries
    Replies: 5
    Last Post: 10-12-2011, 02:18 PM
  3. Replies: 11
    Last Post: 09-22-2011, 01:13 PM
  4. Select Case using query field
    By focosi in forum Programming
    Replies: 4
    Last Post: 08-15-2011, 11:00 AM
  5. Parameter Query: Select From A List?
    By catbob in forum Queries
    Replies: 4
    Last Post: 02-08-2010, 08:24 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