Affichage des articles dont le libellé est Opening Forms based on results of a union all. Afficher tous les articles
Affichage des articles dont le libellé est Opening Forms based on results of a union all. Afficher tous les articles

Opening Forms based on results of a union all

lundi 13 avril 2015

Hi peeps,



I have some code in my database that will open a form based on the result of , I think, a union query.



Private Sub resultbox_DblClick(Cancel As Integer)



'Open report based on the ID from resultbox listbox



DoCmd.OpenReport "ResultsStan", acViewReport, , "[ID] = " & Me.resultbox, , acDialog

'End If



End sub



What I need to do is open one of a number of reports. The report that needs to be opened depends on another value that is passed from the union query - DOCCAT



Being still a bit of a novice I tried...



'If "[DOCCAT]= " & Me.resultbox Like "Standards" Then

DoCmd.OpenReport "ResultsStan", acViewReport, , "[ID] = " & Me.resultbox, , acDialog

'End If



Needless to say it didn't work.



Am I close or way off the mark? Pointers or code would be very much appreciated.



Thanks in advance

Dan

Opening Forms based on results of a union all

Labels