I have a simple database with 56-Queries that runs by passing parameters from specific forms. It works perfect!!!
The problem is, I`m running out of space in the navigation pane, with 56 queries and more parameter queries to come.
I would like to build parameter query in VBA so as to have user friendly database using the following code!
Expand|Select|Wrap|Line Numbers
- Private sub parameterquery()
- Dim stringSQL As DAO.Workspace 'Current workspace (for transaction).
- Dim db As DAO.Database 'Inside the transaction.
- Dim bInTrans As Boolean 'Flag that transaction is active.
- Dim stringSql11 As String 'Action query statements.
- Dim strMsg As String 'MsgBox message.
- 'Step 1: Initialize database object inside a transaction.
- Set stringSQL = DBEngine(0)
- stringSQL.BeginTrans
- bInTrans = True
- Set db = stringSQL(0)
- stringSql11 = "Delete tblMytableName.Field1, tblMytableName.Field2, tblMytableName.Field3 FROM tblMytableName WHERE (((tblMytableName.Field1)=Me![FormsField1]));"
- db.Execute stringSql11, dbFailOnError
- stringSQL.CommitTrans
- End Sub
Where am I doing Wrong???
Please help!!!!!