I created a table listing all the different reports/forms and Crosstab queries i require, and wants to select the relevant reports/queries/or forms from there using the "after update" function, based on the Id field of the specific Report/Query or form in the "AllTblFinRepor ts" table where i listed it.
When i use my vba code, it opens up all the reports/forms or queries at once.
finreports1 is a textbox using "=[finreports].[Column](0)" from the id field in the combobox
I have tried all sorts of configurations with "elseif" and "else" and with "end if" without success.
Any suggestions will be welcomed please
When i use my vba code, it opens up all the reports/forms or queries at once.
finreports1 is a textbox using "=[finreports].[Column](0)" from the id field in the combobox
Code:
If IsNull(Me![facility1]) Then Exit Sub Else If Me.finreports1 = "1" Then DoCmd.Minimize DoCmd.OpenForm "frmViewcaptTrans", acFormDS, "", "", acEdit, acNormal If Me.finreports1 = "2" Then DoCmd.Minimize DoCmd.OpenForm "frmPharmTopmedsCnt", acFormDS, "", "", acEdit, acNormal DoCmd.Maximize If Me.finreports1 = "3" Then DoCmd.Minimize DoCmd.OpenForm "frmPharmTopmeds2", acFormDS, "", "", acEdit, acNormal DoCmd.Maximize If Me.finreports1 = "4" Then DoCmd.Minimize DoCmd.SetWarnings False DoCmd.OpenQuery "UpdateNPITID2", acViewNormal, acEdit DoCmd.OpenQuery "UpdateNPITID3", acViewNormal, acEdit DoCmd.OpenQuery "UpdateNPITID4", acViewNormal, acEdit DoCmd.OpenQuery "UpdateNPITID5", acViewNormal, acEdit DoCmd.OpenQuery "UpdateNPITID6", acViewNormal, acEdit DoCmd.SetWarnings True DoCmd.OpenReport "rptNPConsumeSummary", acViewPreview, "", "", acNormal If Me.finreports1 = "5" Then DoCmd.Minimize DoCmd.OpenReport "rptfutureexpire", acViewPreview, "", "", acNormal DoCmd.Maximize End If
Any suggestions will be welcomed please
Comment