Detail in form

nancy54

Registered User.
Local time
, 20:35
Joined
Jun 19, 2018
Messages
49
I have a form where the Detail Visible is set to No.
I have a search button with the following code below.
The search seems to work, but the Detail section does not become visible.

Private Sub Command202_Click()
ApplyFilter = [Alternate ID] Like "*" & [Forms]![Assign/EMail/Print Report]![Text203] & "*"

Detail.Visible = True

End Sub

Thanks, Nancy
 
For starters, try disambiguating:

Me.Detail.Visible = True
 
Paul, Thanks for getting back...

But, still does not work.
However, If I take the search out, the Detail becomes visible.

Nancy
 
I've never used ApplyFilter, I get an error trying it. This works for me:

Me.Filter = "[Make] Like '*Dell*'"
Me.FilterOn = True
Me.Detail.Visible = True
 
I am guessing you are setting the filter to affect the detail. Have you tried making the detail visible first? Any chance the height went wonky also?

I'd also review your naming conventions. Spaces and special characters will often come back to bite you at the least opportune times. The same is true of control names that are often meaningless, such as "Text203".
 
Oh, for you that would be something like:

Me.Filter = "[Alternate ID] Like "'*" & [Forms]![Assign/EMail/Print Report]![Text203] & "*'"

By the way, the spaces and symbols in your names will prove to be more trouble than they're worth in the long run.
 
@ Paul, normally you see it as DoCmd.ApplyFilter instead of just ApplyFilter. I don't think it will work as is. May be erroring before hitting the .visible in there.
 
Yeah, I got a compile error "undefined variable" as I would expect. Curious that it was apparently working for Nancy.
 
Paul, you use Option Explicit, correct?

Nancy, do you use Option Explicit at the top of all of your modules so that ACCESS forces you to declare variables first? It is really handy as it avoids some issues with misspellings.
 
Thanks Guys,
I'll try fixing the spaces and removing the symbols.

To Mark- Yes, the height of the Detail section is gone; only the header shows (which is where I have the search button). It comes back when the Visible command works, or if you maximize the screen...

I am doing this (visible command) to force the user to use the search button on the form so only one record will print or email.

Nancy
 

Users who are viewing this thread

Back
Top Bottom