Combo box Restriction

Bigthinkor

New member
Local time
Today, 01:14
Joined
Jan 12, 2011
Messages
8
Hello everyone
I hope everyone is having a wonderful weekend. I certainly enjoy having the time off to enjoy some of the things I love to do. One of my most current task.
I have a combo box with a drop-down list of all my forms. Some of my forms have sub forms which are okay, but I do not want the sub forms showing up by themselves, how do I restrict certain forms from the list?

:(

SELECT Name FROM MsysObjects WHERE Type = -32768 ORDER BY Name;

Private Sub Combo61_AfterUpdate()
DoCmd.OpenForm Me.Combo61
End Sub
 
I don't believe that there is any way of identifying a sub form other than by it's name. So if you have a naming protocol that, say, puts the suffix sub on the end of a form name you could use the following to exclude sub-forms from your list;
Code:
SELECT MSysObjects.Name, MSysObjects.Type
FROM MSysObjects
WHERE ((Right([Name],3)<>"Sub") AND ((MSysObjects.Type)=-32768));
 
Think you it worked
 

Users who are viewing this thread

Back
Top Bottom