Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I make the form visible again?

Status
Not open for further replies.

Steven811

Technical User
Apr 15, 2004
76
GB
I am creating a set of cmd buttons on a parent form for navigation around that and the 4 nested sub forms. When I move the focus to one of the sub forms and use the button the parent form becomes invisible.

How do I change this so that it remains visible at all times?

Here is the code for one of the buttons

Private Sub cmdPrevious_Click()

On Error GoTo cmdPrevious_Click_Err

Screen.PreviousControl.SetFocus
DoCmd.GoToRecord , "", acPrevious

cmdPrevious_Click_Exit:
Exit Sub

cmdPrevious_Click_Err:
MsgBox Error$
Resume cmdPrevious_Click_Exit

End Sub

I've tried

Private Sub Form_LostFocus()
MyForm.Visible = True
End Sub

But it still doesn't work.

Any assistance would be appreciated.

Thanks
 
Hi Steven,

Do you have any code for making the form not visible? or closed? nothing from the code that you posted is making the form not visible
 
How are ya Steven811 . . . . .

Hmmmmm . . . . are you saying [blue]cmdPrevious[/blue] is the button your using when the form disappears?

If not . . . . post the code for the button/s causing the disappearence.

Calvin.gif
See Ya! . . . . . .
 
Hi Guys

Thanks for having a look.

When I use the cmd buttons located on the parent form, with the cursor in the sub form, the parent vanishes. This is not intentional and I thought that it must be a built in characteristic that I wanted to stop.

The button that use is cmdNext which has exactly the same code as cmdPrevious.

What a puzzle.
 
OK Steven811 . . . . .

I just ran a [blue]simulation[/blue] and got what I already knew. Everything works as it should, except if [blue]1st Record and GotoPrevious[/blue] or [blue]NewRecord and GotoNext[/blue], a message bacically stating [purple]Can't Goto Record[/purple]. This is the error traping working and is proper.

[purple]So something is definitely wrong![/purple] Try [blue]Compact & Repair[/blue], see if that helps. Then try copying & pasting the mainform ([purple]with content![/purple]). If that does'nt work, delete and reconstruct the form. I know ya don't wann do this, but your stuck with something [purple]unknown[/purple]. Only way at this point I suggest you get rid of it. [blue]If it still does'nt work, then were talking reinstall![/blue]

[blue]GoodLuck![/blue] . . . . Let us know how ya make out . . .



Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top