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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How could I send a form to the back of a table?

Status
Not open for further replies.

mlrmlr

Technical User
Mar 17, 2006
168
US
Hi,

How can I modify my code (below) to open a table in front of a form? I am currently minimizing the form but I would prefer to send the form to the back of the table.

[BEGIN CODE]
Private Sub WO_View_Table_Click()
On Error GoTo Err_WO_View_Table_Click

Dim stDocName As String
Dim stLinkCriteria As String

'DoCmd.SelectObject acForm, "WO_User_Main_Menu", False
'DoCmd.Minimize

stDocName = "WO _Records"
DoCmd.OpenTable "WO_log_table", acViewNormal, acReadOnly
DoCmd.Maximize

Exit_WO_View_Table_Click:
Exit Sub

Err_WO_View_Table_Click:
MsgBox Err.Description
Resume Exit_WO_View_Table_Click

End Sub
[END CODE]

Thank you so much!
 
Hi mlrmlr, how are you?

This bit of code does for me exactly what you're looking for - it's exactly what you have posted minus the error handling.
Code:
Private Sub WO_View_Table_Click()
Dim stDocName As String

stDocName = "tblEsc"

DoCmd.OpenTable stDocName, acViewNormal, acReadOnly

End Sub

I click the command button on my form, it opens the table in the foreground and maximizes the table; when I close the table, I see the original form in it's previous state.
You mentioned something about minimizing your form, but that part of your code seems to be commented out. Are you manually minimizing your form after you execute your command button?


~Melagan
______
"It's never too late to become what you might have been.
 
Hi Melagan,

The code is not working. The form still remains in front of the table.

I have the form as a pop-up dialog, I'm not sure if that has anyting to do with it.

I am using the minimize code as a last result. When I click on a button to open the table, the table will open and the dialog form will minimize but when I close the table the form does not restore.



 
Yes, the form in popup mode has everything to do with it =) Your minimize method works well if you can trigger an event to re-open the form when you close the other object, but that only works with other forms and reports (on_close event). In your case, that won't work because tables/queries do not have events to trigger code.

Additionally, all of the help files I've come across say the Popup property of a form can be set only in form design view; in other words, not through code.

I'm afraid you might be stuck with the minimize option. The whole point of a popup form is to have it do what it's currently doing. If the form doesn't HAVE to be a popup form, perhaps set it's property to No and manipulate the other popup-like things you need the form to do through code?




~Melagan
______
"It's never too late to become what you might have been.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top