Create a form have 'group' like report

namserious

New member
Local time
Today, 10:31
Joined
Jun 28, 2011
Messages
6
Hi everybody,
I have a problem with form design. I am designing a form and my boss want me to use group like report. Because my form has some text boxes and combo boxes If I use report I cannot input data into these controls, if I use form I cannot 'group'. I tried some ways but not effective. Can anybody give me some tips or another solution?

Thanks a lot.
 
Forms do not have Sorting and Grouping like reports. If you want to "group" things in a form you typically do so by setting up a main form/ sub form where the main form is based on a table or query that represents the "parent" entity and the sub form displays records that represent the "child" entity. You can also set up a tab control on a form with different sub forms (or entities) displayed on each tab.
 
Thanks for your reply, Beetle. I tried to created a text box that contains 'group header' and a subform that contains detail of 'group header', then I put them (text box and subform ) into detail of main form. After that, I want to change main form from single form -> continuous form, but I can't, Access doesn't allow :confused:. How can I handle it?
 
You can do this, but you need to place two continuous sub forms on a main form and then link them via a text box. For details see this link.
 
Thanks Beetle. I am 'researching' your sample. Is it possible If I want to display like this.
-----------------------------------
EmployeeID |
------------------------------------
EmployeeName |Mobile |
---------------------------------------
EMPL1
--------------------------------
Name1 |xxxxxxx |
----------------------------------
Name2 |yyyyyyyy |
----------------------------------
EMPL2
---------------------------------
Name3 |yyyyyxxg |
---------------------------------
Name4 |xzzzzzzz |
---------------------------------

Here is sample table
-------------------------------------------------
ID |EmployeeID |EmployeeName | Mobile |
-------------------------------------------------
1 |EMPL1 |Name1 |xxxxxxx |
-------------------------------------------------
2 |EMPL1 |Name2 |yyyyyyyy |
-------------------------------------------------
3 |EMPL2 |Name3 |yyyyyxxg |
-------------------------------------------------
4 |EMPL2 |Name4 |xzzzzzzz |
-------------------------------------------------

//I am sorry for this rudeness but I don't have enough permission to post image :(
 
Here is sample table
-------------------------------------------------
ID |EmployeeID |EmployeeName | Mobile |
-------------------------------------------------
1 |EMPL1 |Name1 |xxxxxxx |
-------------------------------------------------
2 |EMPL1 |Name2 |yyyyyyyy |
-------------------------------------------------
3 |EMPL2 |Name3 |yyyyyxxg |
-------------------------------------------------
4 |EMPL2 |Name4 |xzzzzzzz |
-------------------------------------------------

If an Employee can have more than one "Name" and more than one "Mobile", then that data should be stored in a separate related table. You would then set up a main form/sub form where the main form displays the basic info about the employee and the sub form displays all the related "names" and "mobiles".
 
Thanks for your reply.
I tried this way but I don't know how to generate text box that contains header and subform that contains detail via text box (header) automatically (as I said I put them into the detail of main form that means I want them to generate automatically). Could you show me?
 
I tried this way but I don't know how to generate text box that contains header and subform that contains detail via text box (header) automatically

I'm not sure what you mean by this statement. There are a couple of ways you can approach this;

1) Create a main form based on the table that represents the main entity. This would be a standard form, not a continuous form. Then in the detail section of that form you place a continuous sub form displaying data from the table that represents the "child" entity. In this scenario the link between the two forms is handled by using the related fields in the Master/Child Link property of the sub form control.

2) You create an unbound main form, and in the detail section of that form you place two continuous sub forms, one based on the main table and one based on the child table. In this scenario there is a (usually hidden) text box that is used in the Master/Child Link property (which is described in more detail in the link I posted previously).

However, having said that, you appear to be using an improperly normalized table structure, and that is the problem you need to resolve first, before getting involved in form design. You could waste a lot of time and effort trying to get your forms to work the way you want, only to realize later that your table structure just won't work and you have to blow it up and go back to the drawing board.

If you want to upload a copy of your db I can take a look at it and perhaps offer more avice. If you do, it needs to be in .mdb (A2003 or older) format.
 
Hi Beetle,
I really appreciate your help. This time, I only make a form like sample I posted. I hope you and others give me some advice.

Thanks everyone.
 

Attachments

Last edited:
I'm not completely sure if this is what you're trying to accomplish, but I've reattached your file. Look at frmBmain.

On a side note, It seems highly unusual (and not good practice) to have the same EmployeeID related to more than one employee. Maybe that's just how you have it in your sample file (hopefully).
 

Attachments

Thanks for your help, Beetle.
It might be completely not like I hope but I think I will use this solution because It might be impossible to layout a form like this design (you can see the image I posted below).


p/s: About the tables of my sample, actually I have some tables that are more complicated. In my sample, I tried to make them easy to understand.

Thanks everyone.
 

Attachments

Users who are viewing this thread

Back
Top Bottom