You're using not the parent CommandBars, but a child menu. Try it this way:
Set objInsp = Item.GetInspector
Set colCB = objInsp.CommandBars
Set objCBB = colCB.FindControl(, 30145)
If Not objCBB Is Nothing Then
MsgBox "CommandBar ID 30145 Is visible (T/F): " & objCBB.Visible
End If
Set objCBB = nothing
Set colCB = Nothing
Set objInsp = Nothing

Signature
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
> I read your response and didn't quite understand it, but I went ahead and
> tried what I thought you meant by checking for the "Forms" menu item.
[quoted text clipped - 8 lines]
>
> > See answer posted to a similar question last week at
http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public
.outlook.program_forms&mid=fbb81ee8-0641-43d8-a1a5-05c0a214d246
> > > Is there some code that I can put in my Custom Form VBScript to tell
> that
[quoted text clipped - 5 lines]
> > >
> > > TIA!
Bryan Dickerson - 29 Jun 2004 19:43 GMT
It still says "False" both ways. I guess I'm still doing something wrong.
Hmmm... Could it be that I have it in the Item_Open event which actually
runs before anything is displayed? If so, then is there anything else? My
dilemma is that I have a database insert in the Item_Open that I would
really not like to happen if I'm working on the form, but if I'm opening up
the form for testing or if a user is opening the form then it's ok. I get
tired of going back and deleting all the records that got inserted just
because I was editing the form.
> You're using not the parent CommandBars, but a child menu. Try it this way:
>
[quoted text clipped - 22 lines]
> >
> > > See answer posted to a similar question last week at
http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public
.outlook.program_forms&mid=fbb81ee8-0641-43d8-a1a5-05c0a214d246
> > > > Is there some code that I can put in my Custom Form VBScript to tell
> > that
[quoted text clipped - 6 lines]
> > > >
> > > > TIA!
Sue Mosher [MVP-Outlook] - 29 Jun 2004 21:44 GMT
Ah, you're using this code in the Item_Open event! I think you're correct
that Item_Open fires *before* the item switches into design mode and that,
therefore, there's no way to use that event to determine what state the item
is in.
Why are you doing a database insert in Item_Open? Wouldn't that create a lot
of extraneous items when the user opens and item and then discards it?

Signature
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
> It still says "False" both ways. I guess I'm still doing something wrong.
> Hmmm... Could it be that I have it in the Item_Open event which actually
[quoted text clipped - 4 lines]
> tired of going back and deleting all the records that got inserted just
> because I was editing the form.
Bryan Dickerson - 29 Jun 2004 22:18 GMT
True. I guess I was so enamored with the way the ODBC stuff was being
inserted and running so well that I lost track of the program flow. It
would make more sense to wait until the user hits the "Save" button to do
the insert.
Thanks for the perspective, too!
> Ah, you're using this code in the Item_Open event! I think you're correct
> that Item_Open fires *before* the item switches into design mode and that,
[quoted text clipped - 14 lines]
> > tired of going back and deleting all the records that got inserted just
> > because I was editing the form.