Why won’t my Access subform stay put?

115 pts.
Tags:
Microsoft Access
Microsoft Access subforms
Hi,

I have a main form with a subform below it. The subform supposed to be invisible and 5" from the top. When I click a button, it becomes visible and 0" from the top. When I double click the button, the subform is supposed to go back to being invisible and 5" from the top. For some reason, though, it ended up stuck at the top, even when it is invisible, and it remains there, covering all the data in my main form. When I try to reset the subform property to 5", my main form ends up cut off at the top and I don't understand why. I don't even know where to start looking for solutions. It's driving me crazy. Any insight would be much appreciated. Thank you!

 

 

 

 



 

 

Answer Wiki

Thanks. We'll let you know when a new response is added.

Using a click and double_click event on the same control can be problematic; chances are the double_click event is not firing due to timing with the double click. I recommend either using two different buttons; one for showing, one for hiding or try the below code, which uses the button caption to determine hiding or showing the sub form.

Private Sub Command1_Click()

If Command1.Caption = “Hide Form2″ Then
Form2.Visible = False
Form2.Top = 5
Command1.Caption = “Show Form2″
Else
Form2.Visible = True
Form2.Top = 0
Command1.Caption = “Hide Form2″
End If

End Sub

Jules,

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Dataempress
    I didn't even think that double-click might be interfering. I added buttons to hide the forms and it's working well. Thank you.
    115 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following