A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

pop behind



 
 
Thread Tools Display Modes
  #1  
Old May 22nd, 2008, 03:59 PM posted to microsoft.public.access.forms
rml
external usenet poster
 
Posts: 172
Default pop behind

I have the following code on a form. The form is modal and popup. This
allows me to maximize the form on load. My problem is that when I click that
button, it is behind the main form. How can I make it be in front without
losing the modal and popup?

Thanks.


Private Sub Command265_Click()
On Error GoTo Err_Command3_Click

'Old Code
'========================
'Dim stDocName As String
'stDocName = "Codes"
'DoCmd.OpenQuery stDocName, acNormal, acEdit

Dim strSQL As String

'Construct our SQL Statement
strSQL = "SELECT code, [Codes].Make, [Codes].Description" & _
" FROM [Codes]" & _
" WHERE code IN (" & fcnFormatList([Forms]![parts]![Model]) &
");"

'Execute the SQL through the Current Project connection
CurrentProject.Connection.Execute "CREATE VIEW tempView AS " & strSQL

'Open the Query
DoCmd.OpenQuery "tempView", acViewNormal, acReadOnly

'Drop the Query
CurrentProject.Connection.Execute "DROP VIEW tempView"

Exit_Command3_Click:
Exit Sub

Err_Command3_Click:
MsgBox Err.Description
Resume Exit_Command3_Click

End Sub
  #2  
Old May 23rd, 2008, 02:28 PM posted to microsoft.public.access.forms
Maurice
external usenet poster
 
Posts: 1,585
Default pop behind

Difficult if you don't want to lose the modal and popup because that's what
modal and popup do.

You might give it a try by setting the modality of the form temporarily to
non-modal en when the query is closed set it back to modal again.

Something like:

me.modal=false
docmd.restore '- removing the maximization of the form so the query can be
viewed

the form will stay in front of the query due to the popup setting.
The only thing you have to figure out is how to set the modality back to
modal again with me.modal=true.

I think you are better of creating a form in datasheet mode displaying the
records.

Create a second form
Open the second form from the first form showing the query results in
datasheetview as follows:

DoCmd.OpenForm "form2", acNormal, , , , acDialog

this will open the form in front of the first form without losing the modal
and popup features...

hth
--
Maurice Ausum


"rml" wrote:

I have the following code on a form. The form is modal and popup. This
allows me to maximize the form on load. My problem is that when I click that
button, it is behind the main form. How can I make it be in front without
losing the modal and popup?

Thanks.


Private Sub Command265_Click()
On Error GoTo Err_Command3_Click

'Old Code
'========================
'Dim stDocName As String
'stDocName = "Codes"
'DoCmd.OpenQuery stDocName, acNormal, acEdit

Dim strSQL As String

'Construct our SQL Statement
strSQL = "SELECT code, [Codes].Make, [Codes].Description" & _
" FROM [Codes]" & _
" WHERE code IN (" & fcnFormatList([Forms]![parts]![Model]) &
");"

'Execute the SQL through the Current Project connection
CurrentProject.Connection.Execute "CREATE VIEW tempView AS " & strSQL

'Open the Query
DoCmd.OpenQuery "tempView", acViewNormal, acReadOnly

'Drop the Query
CurrentProject.Connection.Execute "DROP VIEW tempView"

Exit_Command3_Click:
Exit Sub

Err_Command3_Click:
MsgBox Err.Description
Resume Exit_Command3_Click

End Sub

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:22 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.