I have a table named "JewelryStyles" in that table I have 2 text field that contains names of form I want to open using VBA at a specific point, in my recordset, I have the name of form, so what should be the command to open that form from an rst?
Image:
Here is the code so far:
Image:
Here is the code so far:
Code:
Private Sub STYID1_Click()
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Set dbs = CurrentDb
Dim strSQL1 As String
strSQL1 = "SELECT JewelryStyles.StylesID, JewelryStyles.JewelryStyles, JewelryStyles.Styles, JewelryStyles.OrdreTri, JewelryStyles.FormForSizes, JewelryStyles.FormForColors FROM JewelryStyles WHERE JewelryStyles.OrdreTri=1 ORDER BY JewelryStyles.OrdreTri"
Set rst = CurrentDb.OpenRecordset(strSQL1, dbOpenDynaset, dbSeeChanges)
Me.StyleCode = rst![JewelryStyles]
rst.Close
dbs.Close
Set rst = Nothing
Set dbs = Nothing
DoCmd.OpenForm rst!FormForSizes