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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|