123FakeSt
IS-IT--Management
- Aug 4, 2003
- 182
I want to store all of my actions for my command buttons in a table, so when a form is loaded, the actions are loaded from the table.
The buttons that open new forms (form navigation) was easily accomplished with this code (where menAction value of 1 is open form and 2 is run code):
Any hints? I hope I don't have to write to a module and assign it to the buttons to do this...
The early bird gets the worm, but the second mouse gets the cheese.
The buttons that open new forms (form navigation) was easily accomplished with this code (where menAction value of 1 is open form and 2 is run code):
Code:
Dim strSQL As String
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
strSQL = "SELECT * FROM utbMenu WHERE menOrder = " & intOption & " AND menSource = '" & Me.Name & "'"
rst.Open strSQL, CurrentProject.Connection, adOpenForwardOnly, adLockReadOnly
If Not rst.EOF Then
rst.MoveFirst
Select Case rst!menAction
Case 1
DoCmd.OpenForm rst!menForm, acNormal, , , , acWindowNormal
Case 2
'execute the procedure rst!menCode
End Select
End If
Any hints? I hope I don't have to write to a module and assign it to the buttons to do this...
The early bird gets the worm, but the second mouse gets the cheese.