Open Specific Form Based on Criteria (1 Viewer)

tl mike

Registered User.
Local time
Today, 14:31
Joined
Sep 7, 2007
Messages
117
I am trying to make a sub form open a specific form based on criteria of the sub form right now I have:

Private Sub Form_DblClick(Cancel As Integer)
Dim rs As Object

DoCmd.OpenForm "frmCatalog"

Set rs = Forms!frmCatalog.Recordset.Clone
rs.FindFirst "ProductPK = " & Me.ProductPK
Forms!frmCatalog.Bookmark = rs.Bookmark

End Sub

I would like to add in the ability for it to look at the product type and open a form specific to that product type from a cascade index I have setup I. E.

ProductPK_______ TypeFK_____________Form
Mouse__________ Input Device__________frmInput
KeyBoard________Input Device__________frmInput
Dell 4400 ________Computer____________frmComputer
Dell 6400 ________Computer____________frmComputer
Monitor __________Output Device_________frmOutput
Dell 46 Speaker____Nothing entered_______frmGeneric


So if I double clicked on the Dell 4400 product in the sub form it would open the frmComputer form to that Dell 4400 record.

And if there is no type entered it would open a generic form frmGeneric.
 
Last edited:

tl mike

Registered User.
Local time
Today, 14:31
Joined
Sep 7, 2007
Messages
117
Attached sample db
 

Attachments

  • db4.zip
    181.7 KB · Views: 186

Users who are viewing this thread

Top Bottom