I useing the code from Allen Browne. It works great to create a drop down
box to select reports, but I don't know the code to put into the
"Afterupdate" of the list box that would open the selected report in a
Preview Mode. Any help would be great....
Here is Allen's code used in the row source of the list box:
SELECT MsysObjects.Name
FROM MsysObjects
WHERE (((MsysObjects.Name) Not Like "~*" And (MsysObjects.Name) Not Like
"MSys*") AND ((MsysObjects.Type)=-32764))
ORDER BY MsysObjects.Name;
I useing the code from Allen Browne. It works great to create a drop
down box to select reports, but I don't know the code to put into
the "Afterupdate" of the list box that would open the selected
report in a Preview Mode. Any help would be great....
Here is Allen's code used in the row source of the list box:
SELECT MsysObjects.Name
FROM MsysObjects
WHERE (((MsysObjects.Name) Not Like "~*" And (MsysObjects.Name) Not
Like "MSys*") AND ((MsysObjects.Type)=-32764))
ORDER BY MsysObjects.Name;
The sql statement I have posted in the combo box's row source is not a
function, but just a source. So where or how would I incorporate your code
in the statement? Here is both the row source and your code:
SELECT MsysObjects.Name
FROM MsysObjects
WHERE (((MsysObjects.Name) Not Like "~*" And (MsysObjects.Name) Not Like
"MSys*") AND ((MsysObjects.Type)=-32764))
ORDER BY MsysObjects.Name;
If Me!TheComboName.ListIndex <> -1 Then
DoCmd.OpenReport Me!TheComboName.Value, acViewPreview
Else
MsgBox "You must select a report first!"
End If
Roy, I got it. I just had to get my head around it. Your code worked great
when I created a Sub for it and then called that sub in the afterupdate of
the text box. Thanks.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.