Originally Posted by
Micron
Confusing. Tabbed forms display side by side. I don't think there is such a thing as a tabbed window but I guess that's subject to one's interpretation. If your forms are set to be 'overlapping windows' then open the form modal. That should force it to stay on top, but you will not be able to interact with any other db object until that form is closed. Lastly, a navigation form is another thing altogether so if that's where you're opening this other form then none of that applies.
Sorry for the confusion, I was referring to the tabbed forms that are being displayed from left to right. The forms and my database are not set to be 'Overlapping Windows' and my navigation form is really a collection of command buttons.
This is the sequence of events that are leading to my current issue:
One the main cable navigation form, the user would click on a button captioned 'Search By Text' and that would open the search by text form via DoCmd.OpenForm :
Code:
Private Sub btnMainFormTextSearch_Click()
DoCmd.OpenForm "frmCableTextSearch", acNormal, , , , acWindowNormal
End Sub
After that form is open, the user would enter the text that they want to search the database for and click a button captioned 'Search'. The code that I have for the search button is:
Code:
Private Sub btnCableTextSearch_Click()Dim txtSearchCritera As String
txtSearchCriteria = "cableSouceDescription Like '*" & Me!txtCableTextSearch & "*'"
Debug.Print txtSearchCriteria
If IsNull(Me.txtCableTextSearch) Then
MsgBox "Nothing Was Entered", vbOkayOnly, "Invalid Entry"
txtSearchCriteria = ""
Me.txtCableTextSearch.SetFocus
Else
DoCmd.OpenForm "frmCableInformation", acNormal, , txtSearchCriteria, , acWindowNormal, "Edit"
txtSearchCriteria = ""
DoCmd.Close acForm, "frmCableTextSearch", acSaveNo
End If
End Sub
The form "frmCableInformation" opens and I can see the tab, but the first "navigation" form is still the active tab after "frmCableTextSearch" is closed.
Where I am getting confused at this that I have another search function that I designed for looking up a cable by an assigned number and I have the DoCmd.OpenForm command structured in the same fashion but I don't experience the same problem.
Here is the snippet of that code for the search by cable number:
Code:
If countRecords > 0 Then
cableNumberCriteria = "cableCategory_PK = " & convertCatString & " And CableNumber = '" & strNumberSplit & "'"
Debug.Print cableNumberCriteria
DoCmd.OpenForm "frmCableInformation", acNormal, , cableNumberCriteria, , , "Edit"
ElseIf countRecords = 0 Then
MsgBox "No Matching Cable Number Found", vbOKOnly, "Search By Cable Number"
End If
Could this issue be as simple as the fact that in on situation I am opening a form, running a search, then trying to open the form with the search results versus running a search and then just opening the forms that match the search criteria?