Results 1 to 7 of 7

Thread: Subforms

  1. #1
    Join Date
    Jul 2004
    Location
    Kent
    Posts
    59

    Question Unanswered: Subforms

    Hi
    I've created a test database, for orders and stock.

    For quering orders i created a simple query based on a users input from a form (QBF_Form) the problem im having is that i have put the QBF_Form onto my ClientOrders form (in a subform) and now the QBF_Form does not work, before i could just enter the details of the record i was looking for and it would bring up a query with the required results, now im prompted for the criteria even though i have entered it on the form.

    I think its something to do with the query but not sure what.

    Any help appriciated.

    Mike
    Attached Files Attached Files

  2. #2
    Join Date
    Jul 2004
    Location
    Blackburn, UK
    Posts
    169
    Downloaded you test mdb and im afraid to say that it worked fine for me?
    The query brough up the result of what i was searching for fine and never prompted me for anything?

    Is there any specfic thing it is prompting you for?

  3. #3
    Join Date
    Jul 2004
    Location
    Blackburn, UK
    Posts
    169
    no i take it back,i know what you mean!
    Its because it is a subform, you need to say what form it is in first so,
    To get a reference to one of the fields it would be
    Forms![ClientOrders]![QBF_Form]<Field Name>
    It is trying at the moment to take information from a form that isnt open so you need to refernce the sub form.

    I know all about this as i had the same problem with msgbox's at one point and not telling them the right location to return a field

  4. #4
    Join Date
    Jul 2004
    Location
    Kent
    Posts
    59

    Many Thanks

    Hi
    Many, Many, Many, Thanks, It works a treat now, had a feeling it was something like that, but couldn’t figure it out, my knowledge its that good yet but im getting there now.

    Does anyone know how to get the db to open the results of the query staight in to my report as at the moment i have to do the QBF_Form search then click the invoice button manualy to display the invoce for a particullar client.

    I can do it with the macro:
    macro does the search and returns results,
    minimizes the query results window,
    opens report in print preview mode
    then it closes the query in background

    Is this the best way of doing this?
    See attached

    Thanks again,

    Mike
    Attached Files Attached Files

  5. #5
    Join Date
    Jul 2004
    Location
    Blackburn, UK
    Posts
    169
    Havn't worked with reports for a while now but if memory serves right then just having the query as your record source in the report means that it will take information from the query, you dont need to open the query then the report?

    If i was you id get into using VBA aswell, you'll never look back, havnt used a macro in about a year now, VBA is a lot more versatile and you would be suprised at what you can do with it.

    I want to know something you have done by the way, one of the sub reports you have added something next to an order that opens to show more in depth

    Next to the order it says "+" which opens up another sub report i think, never seen that before, i like it

  6. #6
    Join Date
    Jun 2004
    Posts
    92
    Quote Originally Posted by ChrisGolden
    Next to the order it says "+" which opens up another sub report i think, never seen that before, i like it
    The reason that the + is appearing is due to a relationship between two tables. It lists the records in the related table for the records in the displayed table.


    Quote Originally Posted by Icerat
    Does anyone know how to get the db to open the results of the query staight in to my report as at the moment i have to do the QBF_Form search then click the invoice button manualy to display the invoce for a particullar client.
    Icerat, what do you mean by that? You can base a report off of a query and that will "open the results of the query straight into the report." If thats not what you mean, maybe you can ellaborate.

  7. #7
    Join Date
    Jul 2004
    Location
    Blackburn, UK
    Posts
    169
    [QUOTE=sionus]The reason that the + is appearing is due to a relationship between two tables. It lists the records in the related table for the records in the displayed table.

    Is that what that is?? Must be because ive never used a datasheet in a subform, always use continuous form! Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •