Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    marcosedh is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2016
    Posts
    10

    Unhappy Merge two controls into one, please help

    Im a self-taught access user so I don't know much about terms or tricky stuff..



    Im desperate to find a way to merge two controls into one, for example:

    I have this 2 controls: First Name & Last Name.

    I want to create one expression off those two controls named "Student Name".


    --- using =[First name]&" "&[Last Name] won't work for my purpose ---

    Thank you very much and have a nice day

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    What kind of controls and why won't the concatenation work?

  3. #3
    marcosedh is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2016
    Posts
    10
    Quote Originally Posted by RuralGuy View Post
    What kind of controls and why won't the concatenation work?
    It won't work because I created a sub form with a "create report button" and whenever I create the report, it will display the current student name in such report with the data of all students combined. So I want to create a page in that report for each student. Hope I explained myself, english is not my native language heh

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    What code/macro is behind the "create report button"?

  5. #5
    marcosedh is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2016
    Posts
    10
    I used the create report wizard

  6. #6
    marcosedh is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2016
    Posts
    10
    Private Sub Command54_Click()
    On Error GoTo Err_Command54_Click


    Dim stDocName As String


    stDocName = "Observaciones"
    DoCmd.OpenReport stDocName, acPreview


    Exit_Command54_Click:
    Exit Sub

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    What is the Record Source of the Report? Can you post the SQL for the Record Source of that Report?

  8. #8
    marcosedh is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2016
    Posts
    10
    The record source is a simple table, so I think there's no SQL, that means I have to create a query for it to work?

  9. #9
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You can also use the WHERE CONDITION argument of the OpenReport command to filter the Report. You said the Button is on the SubForm. Is there a value in the Record Source of the SubForm Record that can be used to filter the Report?

  10. #10
    marcosedh is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2016
    Posts
    10
    Quote Originally Posted by RuralGuy View Post
    You can also use the WHERE CONDITION argument of the OpenReport command to filter the Report. You said the Button is on the SubForm. Is there a value in the Record Source of the SubForm Record that can be used to filter the Report?
    Yes, every entry has its own ID. How can I use the where condition argument to filter by id?

  11. #11
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Here's the syntax of the OpenReport Command:
    DoCmd.OpenReport(ReportName, View, FilterName, WhereCondition, WindowMode, OpenArgs)


    WhereCondition Optional Variant. A string expression that's a valid SQL WHERE clause without the word WHERE.

  12. #12
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    This link has examples of how to use the WHERE CONDITION argument. It uses OpenForm but the syntax is the same for OpenReport.
    http://www.baldyweb.com/wherecondition.htm

  13. #13
    marcosedh is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2016
    Posts
    10
    Im trying these = DoCmd.OpenReport([observaciones], [ViewsAllowed], [Filter], Var([ID], [PopUp], [OpenArgs]) but i get this message:

    "The expression you entered has a function containing the wrong number of arguments."

  14. #14
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Try: DoCmd.OpenReport observaciones, , ,"[ID] = " & [ID]

  15. #15
    marcosedh is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2016
    Posts
    10
    "The expression you entered contains invalid syntax"

    = DoCmd.OpenReport([observaciones], [ViewsAllowed], [Filter], Var([ID] = & [ID], [PopUp], [OpenArgs])
    Attachment 26295

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. merge adta
    By Mina Garas in forum Queries
    Replies: 3
    Last Post: 02-11-2016, 08:07 AM
  2. How do I merge two Queries into one?
    By tmartin in forum Queries
    Replies: 3
    Last Post: 04-06-2015, 03:46 PM
  3. Replies: 1
    Last Post: 12-03-2014, 06:41 PM
  4. How do I Merge Four Tables Together
    By SteveI in forum Queries
    Replies: 1
    Last Post: 03-04-2010, 10:53 AM
  5. Name Merge
    By leejqs in forum Reports
    Replies: 3
    Last Post: 07-16-2009, 07:02 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