A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Detail Group Visibility State



 
 
Thread Tools Display Modes
  #1  
Old August 13th, 2009, 12:47 AM posted to microsoft.public.access.reports
Jason Rhymes
external usenet poster
 
Posts: 8
Default Detail Group Visibility State

I posted this in the forms NG but I should of posted it here.
I'm trying to control a group visibility state in a report through a form
pick box.
This is what I have but it doesn't work.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If [Forms]![JobList]![Show_Detail] = 0 Then
Me.Detail.Visible = True
Else
Me.Detail.Visible = False

End If
End Sub


  #2  
Old August 13th, 2009, 01:20 AM posted to microsoft.public.access.reports
fredg
external usenet poster
 
Posts: 4,386
Default Detail Group Visibility State

On Wed, 12 Aug 2009 18:47:37 -0500, Jason Rhymes wrote:

I posted this in the forms NG but I should of posted it here.
I'm trying to control a group visibility state in a report through a form
pick box.
This is what I have but it doesn't work.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If [Forms]![JobList]![Show_Detail] = 0 Then
Me.Detail.Visible = True
Else
Me.Detail.Visible = False

End If
End Sub


Just a helpful tip to help you get good responses when asking
questions in newsgroups.
Words like 'it doesn't work' gives any potential reader who might
want to help you absolutely no useful information.
What didn't happen?
What did happen?
What did you expect to happen?
What is the exact code you wrote (copied directly from your database
and pasted here so we can see if you didn't simply mis-write the
code)?
Answers to those questions would be helpful to us .... to help you!

1) The form must be open when the report is run.
2) What is a form 'pickbox'?
3) Assuming the 'pickbox' (whatever kind of control that is) returns a
number value of 0, try ..... (Shortening your code

Me.Section(0).Visible = [Forms]![JobList]![Show_Detail] = 0

Section(0) is the Report detail section.

4) You can also use (in the Detail Format event)

Cancel = [Forms]![JobList]![Show_Detail] 0

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #3  
Old August 13th, 2009, 02:01 PM posted to microsoft.public.access.reports
Jason Rhymes
external usenet poster
 
Posts: 8
Default Detail Group Visibility State

Thanks Fred.
Sorry, Pick Box = Check Box.

In any case, I had the form closing through a macro and that was causing it
to fail.
So that brings up another problem. How do you handle the form being in front
of the report (Access 2007)?
Is there a draw order or something that'll push the form to the back?
I can't access the report with the form still open.

  #4  
Old August 13th, 2009, 03:48 PM posted to microsoft.public.access.reports
fredg
external usenet poster
 
Posts: 4,386
Default Detail Group Visibility State

On Thu, 13 Aug 2009 08:01:57 -0500, Jason Rhymes wrote:

Thanks Fred.
Sorry, Pick Box = Check Box.

In any case, I had the form closing through a macro and that was causing it
to fail.
So that brings up another problem. How do you handle the form being in front
of the report (Access 2007)?
Is there a draw order or something that'll push the form to the back?
I can't access the report with the form still open.


Your not giving enough information.
How are you opening the report?
How is this form being opened?
From the report?
Or is the report being opened from the form?
Is there code in the report's Open event to open the form?
If so, copy and paste it in a new message.
Is there code on the form to close the form or make it not visible?
If so, copy and paste that code.

The normal method that I use is to open the Report. Code in the
report's open event opens the form in acDialog
DoCmd.OpenForm "FormName", , , , , acDialog
(so report processing pauses).
A command button on the form makes the form not visible.
When the command button is clicked processing of the report then
continues.
When the report is closed, I have code in the Report Close event that
also closes the form.
Note: The above method works in all Access versions up thru Access
2003.
I have no idea if 2007 works the same way, but you can try it.


--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #5  
Old August 13th, 2009, 03:55 PM posted to microsoft.public.access.reports
Jason Rhymes
external usenet poster
 
Posts: 8
Default Detail Group Visibility State

Thanks Fred.
Been a while since I did any programming in Access.
I'll try the method you suggest and will post back if it doesn't work but it
looks like that'll work for me.
Thanks again.

Jason

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:43 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.