Invisible subform problem

aranj

Registered User.
Local time
Today, 21:37
Joined
Feb 18, 2003
Messages
44
I have a subform on my main form that contains one field, which is the result of a query. The subform may or may not, therefore, have content; ie the result may be a number or may be null.

My problem is that the subform is only displayed on the main form when the subform has content.

Can anyone help? Thanks.
 
Create a button that goes to the next record on your main form. Enter the following code after the "DoCmd.GoToRecord , , acNext" line of code created by the wizard, changing the "Me.Your_subform" to the name of your subform and [YourFieldWithValue] to the name of the control with the value.


If Me.Your_subform![YourFieldWithValue] <> "" Then
Me.Your_subform.Visible = True
Else
Me.Your_subform.Visible = False
End If


Do the same with a previous button. Hope this helps


IMO
 
Last edited:
Thanks, but no joy.

For some reason when there is no result, the subform does not display.

PS The properties for the subform are already set to visible.
 
Maybe I didn't make it clear? I'd like to subform to always display.
 
Sorry, I thought you wanted the subform to disappear when there was no results

IMO
 

Users who are viewing this thread

Back
Top Bottom