473,513 Members | 2,366 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Issues with 'group by' in form

6 New Member
Hi, Im trying to group by if a value = true in a form and passes to a report and am getting "Object Required" when I attempt this.

Here is my code:

Private Sub Report_Open(Cancel As Integer)
If Forms!frmPMProjectsrptSubForm.chkcoord = True Then
Me.OrderBy = (dbo_view3.Coordinator)
Me.OrderByOn = True
End If
End Sub

Can anyone help? I need to be able to order by a 'check box' in the form (referenced above).

Thanks.
-Bob
Aug 22 '07 #1
2 1329
Rabbit
12,516 Recognized Expert Moderator MVP
What's dbo_view3?
Aug 22 '07 #2
puppydogbuddy
1,923 Recognized Expert Top Contributor
Hi, Im trying to group by if a value = true in a form and passes to a report and am getting "Object Required" when I attempt this.

Here is my code:

Private Sub Report_Open(Cancel As Integer)
If Forms!frmPMProjectsrptSubForm.chkcoord = True Then
Me.OrderBy = (dbo_view3.Coordinator)
Me.OrderByOn = True
End If
End Sub

Can anyone help? I need to be able to order by a 'check box' in the form (referenced above).

Thanks.
-Bob
In order for this to have a chance to work, the form has to remain open until the report is completed. So, the first thing you need verify is that you haven't closed the form before the report opens.

If the above fix does not work, I would change my approach since I don't see how ticked checkboxes (by themselves) are going to provide a sort order. Now if the ticked checkboxes results in filtering certain records to be displayed and you want the report ordered on a specific field in those records, that is a different story. In that case, the way I would do it would be to put the following criteria in the criteria row of the checkbox column in your query (record source for the report) :
Forms!frmPMProjectsrptSubForm.chkcoord = True

and then in the column in your query that you want to sort by, I would select ascending in the Sort row. Then run your report with the revised query and see if it works.
Aug 22 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

19
2438
by: MMMMM | last post by:
Hmmm, my array seems to be emptying itself for no reason. I just want to grab every form element posted to the page into an appropriately sized array... What is going on here? dim arrShort()...
4
2057
by: Smriti Dev | last post by:
Hi There, I'm creating a MS ACCESS database using Ms Access 2000 to store Interpretation requests by different departments in a hospital and Interpreter availability. All internal departments...
4
3353
by: Martin | last post by:
I am using graphics as backgrounds for forms,buttons,labels etc. The question is: is it faster to load all graphics from files on app start or to use it embeded (places in editor during design)....
4
2177
by: Russ | last post by:
To ASP.NET printing experts: My Asp.net web form needs to print some reports at the client side. I've been trying to research this and find some confusing and conflicting information in previous...
5
2031
by: Dev | last post by:
Hello all, I am trying to get a total number of rows returned form a query. SELECT count(this) from table group by this Currently it is returning x rows with a count of each of the group...
10
3063
by: Robert | last post by:
I have an app that was originally 1.1, now migrated to 2.0 and have run into some sporadic viewstate errors...usually saying the viewstate is invalid, eventvalidation failed or mac error. My web...
0
1026
by: Timothy H. Schilbach | last post by:
I have been working on some sample applications to proof new security enhancements as far as roles based and authorization based security. I am using a trest active directory, forms based...
2
3601
by: RoadrunnerII | last post by:
Hi All I am new to this forum and still learning MS Access. Hoping this is the right place to ask If not please let me know! Looking for some help with the SQL statements in Access 2003 with the...
0
7267
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7175
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7120
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5697
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4754
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3247
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3235
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1609
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
466
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.