Results 1 to 6 of 6
  1. #1
    aquazula is offline Novice
    Windows 8 Access 2013
    Join Date
    Nov 2013
    Posts
    3

    a form inside a form according to the details in the main form

    Hi!
    I'm sorry, I'm not sure how to effectively describe in the title about my question/problem.
    The thing is, I want for the access database i'm creating to be able to open new forms inside the main form according to the details in the main form.
    For example: I have a client that wants to buy different products and services, so I want my form to open the form for products and also the form for services. but then, if I have a client that only wants to buy a product and no services, I want the main form to just open the form for products. I don't know how to do it in order for the subforms appear according to the charateristics of my client, that are shown in the main form.
    I see it something similar to the excel "if". "If the -consumer- wants to buy products, then -form for products- opens" or sth like that.

    Hopefully the way I described it was enough for others to understand, I'm sorry for all the troubles i'm causing

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Maybe you can create a field in your tblClients that describes the type/category of client. You could have a yes/no field. Yes might indicate they use both services.

  3. #3
    aquazula is offline Novice
    Windows 8 Access 2013
    Join Date
    Nov 2013
    Posts
    3
    and in the case they use just one service (either product or service)? how can I make access let me open just one of them?
    Another question, would it be possible for sth similar but with more options? like: product A, product B, service A, and service B

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by aquazula View Post
    and in the case they use just one service (either product or service)? how can I make access let me open just one of them?
    Another question, would it be possible for sth similar but with more options? like: product A, product B, service A, and service B
    yes, You could create another table for categories. I would not use a lookupfield in your existing table. you can use lookupfields in forms as an option. I prefer tables, even for things like gender.

    You could also create a column for each catagory. Use a yes no field committed to each type, ie service, parts, consulting, wtc. Different columns might be best. This way, if you add a category, you don't have to add multiple records to represent every possible combination of categories.

  5. #5
    aquazula is offline Novice
    Windows 8 Access 2013
    Join Date
    Nov 2013
    Posts
    3
    Quote Originally Posted by ItsMe View Post
    yes, You could create another table for categories. I would not use a lookupfield in your existing table. you can use lookupfields in forms as an option. I prefer tables, even for things like gender.

    You could also create a column for each catagory. Use a yes no field committed to each type, ie service, parts, consulting, wtc. Different columns might be best. This way, if you add a category, you don't have to add multiple records to represent every possible combination of categories.
    That is a really good option!
    but i don't know how to do the coding part, of "if product A is selected, then open form for product A" (or sth similar).

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Subforms are containers for objects like tables, forms, or queries. The "Subform" container's purpose in life is to display a form (or similar object) within your main form. This container has a name. It does not have to be the same name as the object it contains. You can look at he subform's properties by selecting it (the container) while in your main form's design view and looking at he property Window. Basically, you have two things when you create a subform. You have a control with properties that acts as a container for a form, table, or query.

    If you add new columns to your customer table, yes/no fields to represent the various categories, you can add controls to your main form that are bound to these new fields. For instance, add some checkbox controls.

    You can use code behind your main form, in your main form's current event or afterupdate event of a combobox, to change the properties of your subform. You can change the recordsource based on criteria from the new yes/no fields. Using SQL you can dynamically update the subform's recordsource.

    If you like, you can upload a copy of your DB and I can try to get something started for you.

    There is an example of what I am talking about in a sample DB I uploaded here. It is of cascading comboboxes but it is the same idea.
    https://www.accessforums.net/sample-...xes-38171.html


    .

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

Similar Threads

  1. Replies: 17
    Last Post: 08-22-2013, 08:22 AM
  2. Replies: 2
    Last Post: 11-13-2012, 02:11 PM
  3. Replies: 3
    Last Post: 05-02-2012, 10:13 AM
  4. Replies: 1
    Last Post: 12-11-2011, 11:48 AM
  5. Replies: 3
    Last Post: 04-04-2011, 02:45 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