Results 1 to 4 of 4
  1. #1
    hawkins is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    82

    Query reference to a subform

    I have a main form called Main, and then a subform with a control of ctrYearlySubForm. In the subform I have a combo box, Yearcmb, in which you can choose a year dependent on the name in the main form. I have created a query that I want to use the year from the combo box to be criteria to select data. I have tried using [Forms]![Main].[ctrYearlySubForm].[Form].[Yearcmb] in the criteria portion but that doesnt work. I am having troubles figuring out why that isnt working and even if you can do what im trying to do. Any suggestion will be grealty appreciated!



    Also, on a side question, on the report I have I have query that selects information but when the informaiton is not available the subreport from the query does not show up. I would like it to show that always because it has a tag describing the information, for example location. I was wondering how I could show that all the time. I was going to just take the tag outside the subreport but some of the information when it isnt filled shifts the formatting which I do not want.

    Another question I have is when I used an update query to import data, the numbers instead of 15.45 imported at 15. I was wondering why they rounded the numbers?

  2. #2
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254

    hawkins -

    I would try..

    [Forms]![Main]![ctrYearlySubForm].[Form]![Yearcmb]

    instead of

    [Forms]![Main].[ctrYearlySubForm].[Form].[Yearcmb]

    See if that produces the desired results.

    All the best,

    Jim

  3. #3
    hawkins is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    82
    hmm, that didnt work either for some reason. thanks for the suggestion though. Ive attached a file of my database because it might be easier this way. This is my "test" database. The Month-Year Query is the query that I am using for the subform called Month-Year Query subform and the year is by the Yearly Data Entry tag.

  4. #4
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254

    hawkins -

    I don't have A2007 on my laptop, just A2003. I'll have to take a look at your db when I get home tonight.

    Jim

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

Similar Threads

  1. Replies: 4
    Last Post: 07-07-2011, 03:21 PM
  2. Replies: 1
    Last Post: 05-12-2011, 02:25 PM
  3. form/subform reference problem
    By dbertanjoli in forum Forms
    Replies: 1
    Last Post: 01-10-2011, 03:31 PM
  4. Creating a reference to the subform.
    By evander in forum Forms
    Replies: 2
    Last Post: 05-26-2010, 09:39 AM
  5. Can't reference control in subform
    By evanscamman in forum Forms
    Replies: 0
    Last Post: 12-25-2007, 06:47 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