I don't understand this.

You had 6 forms almost identical: when you clicked on the button "Asset Search", a tabbed form for "Asset Search" opened; when you clicked on the button "Desk Search", another tabbed form opened; same for the other two search forms. The button "Edit Asset" is another tabbed form as is "New Asset". I just moved the pertinent controls to tabs in a tab control. Makes more sense to have 1 form with tabs than to have 6 forms.
Next you had the
DLookup function as the control source for the controls on the search forms AND you had the search forms bound to a table.
Using the Dlookups is
not the right way to go. Since the form is bound to a table (actually, I used a query), each of the search form buttons filters the record set to the record being searched for. If you do the search on the "Asset Search" tab and a record is found, all other tabs reflect that record.
There were only 3 records in the dB, so I changed the 3rd record (Asset Number "SHPCMO03") model to "Pro Three 600" to distinguish it from the other two records.
On the "Asset Search" tab, enter "SHPCMO01" and click the search button. The model should be "Pro One 600".
Enter "SHPCMO03" and click the search button. The model should now be "Pro Three 600".
Click on the "Switch Port Search" tab - the Model should still be "Pro Three 600".
I shouldn't have left the "Quick search" as a sub form - those controls should be on the "
Welcome" form (in MY version of the dB).
Now go to the "
Quick Search" and enter "SHPCMO01". Notice that the model data in the "
Switch Port Search" tab changed from "SHPCMO03" to "SHPCMO01".
Thought that is what you wanted.... but that is easy to remove.......
Comment out or delete the two lines in
GREEN
Code:
Private Sub SearchBox_Exit(Cancel As Integer)
Dim r As DAO.Recordset
Dim txSearchBox As String
Dim sSQL As String
If Len(Trim(Me.sEARCHbOX & "")) > 0 Then
sSQL = "SELECT InfoSheet.Location, InfoSheet.ZoneColor, InfoSheet.Pod, InfoSheet.Desk"
sSQL = sSQL & " FROM [tblAssets] AS InfoSheet"
sSQL = sSQL & " WHERE InfoSheet.[AssetNumber] = '" & Me.sEARCHbOX & "';"
Set r = CurrentDb.OpenRecordset(sSQL)
If Not r.BOF And Not r.EOF Then
Me.Location = r("Location")
Me.ZoneColor = r("ZoneColor")
Me.Pod = r("Pod")
Me.Desk = r("Desk")
' Me.Parent.Filter = "AssetNumber = '" & Me.sEARCHbOX & "'"
' Me.Parent.FilterOn = True
Else
Me.Location = "Asset unknown"
Me.ZoneColor = "Asset unknown"
Me.Pod = "Asset unknown"
Me.Desk = "Asset unknown"
End If
r.Close
Set r = Nothing
Else
Me.Location = vbNullString
Me.ZoneColor = vbNullString
Me.Pod = vbNullString
Me.Desk = vbNullString
End If
End Sub
And
then you said:
So I tweaked it...

..... and now you don't like it?
Doesn't get cleared in the db I just tested..... but maybe I misunderstood again.......
----------------------------------------------------------------------------------------------
The dB I have
does not have the forms with maps. If you add an Asset number in the quick search, then click on the "Avantai" button, a map opens. Using your images, do you want something highlighted to show the Pod/Desk? (Pod 2, desk "E"?) would take a lot of code for
all of the buttons, but it is doable....
