Re: Combo box locked?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Thank Jeff. I think the Dan's suggestion is brilliant too.
I also find out why my combo boxes didn't work in the form. It was because
the form is a startup form, but I didn't specify anything under
Tools_Startup_Dispaly Form/Page. After I did that, these combo boxes are back
to work!

Your kind advice has very helpful and much appreciated.

Cheers,
Sam

"Jeff Boyce" wrote:

> I like Dan's suggestion -- it would simplify what you are doing. And you
> can add a msgbox line of code in the GotFocus event of one of your controls,
> to make sure whether/if it is getting the focus.
>
>
> --
> Good luck
>
> Jeff Boyce
> <Access MVP>
>
> "Sam Kuo" <sam_cy_kuo@xxxxxxxxxx(donotspam)> wrote in message
> news:D42D02F5-C578-435F-B1BA-56A0D447475E@xxxxxxxxxxxxxxxx
> > Hi Jeff,
> >
> > All combo boxes in the form are unbound. All of which are based on the
> same
> > query as the form, except one combo box.
> >
> > I created a solid-filled box that is used to cover up all the controls in
> > the form when the form is opened, so that the user can only see the combo
> > box, which they will then use to reach for records.
> >
> > To make the "cover" work, I make all controls (except combo boxes)
> invisible
> > in the form's OnLoad event. Then make these controls visible again in all
> > combo boxes's AfterUpdate event.
> >
> > This is what my code looks like:
> > ---
> > Private Sub Form_Load()
> > ' Hide the Database Window
> > DoCmd.SelectObject acForm, , False
> > DoCmd.RunCommand acCmdWindowHide
> > ' Hide the Menu Bar (File, Edit, ...etc)
> > DoCmd.ShowToolbar "Menu Bar", acToolbarNo
> > ' Hide the Form View toolbar
> > CommandBars("Form View").Visible = False
> > ' Disable 'Close(X) button' from the application window
> > ' and 'Exit' from File menu
> > Call SetEnabledState(False)
> > ' Disable cboVersionStatus and cboType
> > cboVersionStatus.Enabled = False
> > cboType.Enabled = False
> > ' Hide all controls until a selection is made
> > ' through one of the combo boxes
> > [FormerDWGNo].Visible = False
> > [LatestIssue].Visible = False
> > [DWGNo].Visible = False
> > [VersionStatus].Visible = False
> > [JobNo].Visible = False
> > [NoOfSheets].Visible = False
> > [Category].Visible = False
> > [Type].Visible = False
> > [Size].Visible = False
> > [Code].Visible = False
> > [Title].Visible = False
> > [Material].Visible = False
> > [Originator].Visible = False
> > [OrigDate].Visible = False
> > [ApprovedBy].Visible = False
> > [ApprovalDate].Visible = False
> > [TestEquipment].Visible = False
> > [Note].Visible = False
> > [Comment_Label].Visible = False
> > [Comment1].Visible = False
> > [Comment2].Visible = False
> > [Comment3].Visible = False
> > [cbHideComment].Visible = False
> > [cbViewCategory].Visible = False
> > [cbViewType].Visible = False
> > [cbViewSize].Visible = False
> > [cbStaffListOpen1].Visible = False
> > [cbStaffListOpen2].Visible = False
> > [cbTestHistoryOpen].Visible = False
> > [PDFDrawing].Visible = False
> > [DrawingFile].Visible = False
> > [sfReidAmendedProductDrawings_User].Visible = False
> > [Box95].Visible = False
> > [Box115].Visible = False
> > [Box127].Visible = False
> > ' Set focus to cboDWGNo
> > Me.cboDWGNo.SetFocus
> > ' Maximize the form
> > DoCmd.Maximize
> > End Sub
> > ---
> > ' cboJobNo is one of the combo boxes
> > Private Sub cboJobNo_AfterUpdate()
> > ' Turn off screen repainting and display Hourglass
> > ' until the procedure has finished running
> > Application.Echo False
> > DoCmd.Hourglass True
> > ' Clear cboDWGNo, cboVersionStatus, cboCategory,
> > ' cboType and cboFormerDWGNo (show as blank)
> > Me.cboDWGNo = Null
> > Me.cboVersionStatus = Null
> > Me.cboCategory = Null
> > Me.cboType = Null
> > Me.cboFormerDWGNo = Null
> > ' Clear the list of cboVersionStatus and cboType
> > Me.cboVersionStatus.RowSource = qryReidProductDrawings
> > Me.cboType.RowSource = qryReidProductDrawings
> > ' Disable cboVersionStatus and cboType
> > cboVersionStatus.Enabled = False
> > cboType.Enabled = False
> > ' Unhide all controls after a selection is made
> > ' in this combo box cboJobNo
> > [FormerDWGNo].Visible = True
> > [LatestIssue].Visible = True
> > [DWGNo].Visible = True
> > [VersionStatus].Visible = True
> > [JobNo].Visible = True
> > [NoOfSheets].Visible = True
> > [Category].Visible = True
> > [Type].Visible = True
> > [Size].Visible = True
> > [Code].Visible = True
> > [Title].Visible = True
> > [Material].Visible = True
> > [Originator].Visible = True
> > [OrigDate].Visible = True
> > [ApprovedBy].Visible = True
> > [ApprovalDate].Visible = True
> > [TestEquipment].Visible = True
> > [Note].Visible = True
> > [Comment_Label].Visible = True
> > [Comment1].Visible = True
> > [Comment2].Visible = True
> > [Comment3].Visible = True
> > [cbHideComment].Visible = True
> > [cbViewCategory].Visible = True
> > [cbViewType].Visible = True
> > [cbViewSize].Visible = True
> > [cbStaffListOpen1].Visible = True
> > [cbStaffListOpen2].Visible = True
> > [cbTestHistoryOpen].Visible = True
> > [PDFDrawing].Visible = True
> > [DrawingFile].Visible = True
> > [sfReidAmendedProductDrawings_User].Visible = True
> > ' These are the _covers_
> > [Box95].Visible = True
> > [Box115].Visible = True
> > [Box127].Visible = True
> > ' Apply filter
> > Me.Filter = "[JobNo] = '" & Me![cboJobNo] & "'"
> > Me.FilterOn = True
> > ' When the task is done, change hourglass back
> > ' to a pointer and screen repainting is turned back on
> > Application.Echo True
> > DoCmd.Hourglass False
> > End Sub
> >
> > "Jeff Boyce" wrote:
> >
> > > Sam
> > >
> > > Are the combo boxes bound or unbound?
> > >
> > > --
> > > Good luck
> > >
> > > Jeff Boyce
> > > <Access MVP>
> > >
> > > "Sam Kuo" <sam_cy_kuo@xxxxxxxxxx(donotspam)> wrote in message
> > > news:330DCF29-C357-4646-B0C8-114D8E7BB979@xxxxxxxxxxxxxxxx
> > > > Just to further clarify my situation and hope that helps spotting
> where
> > > the
> > > > problem is...
> > > > I have all the controls (except combo boxes) hidden in the form's
> OnLoad
> > > > event. And in each combo box's AfterUpdate event, all the hidden
> controls
> > > > become visible. In theory this should work and shouldn't be the cause
> of
> > > my
> > > > combo box problem here I guess. So what might be wrong?
> > > >
> > > > Regards,
> > > > Sam
> > > >
> > > > "Jeff Boyce" wrote:
> > > >
> > > > > Sam
> > > > >
> > > > > On every form in your application? On only one form? All combo
> boxes?
> > > > > Only selected combo boxes?
> > > > >
> > > > > --
> > > > > More info, please ...
> > > > >
> > > > > Jeff Boyce
> > > > > <Access MVP>
> > > > >
> > > > > "Sam Kuo" <sam_cy_kuo@xxxxxxxxxx(donotspam)> wrote in message
> > > > > news:0C69E6BB-9EDC-4CF7-9EA2-343D51050C90@xxxxxxxxxxxxxxxx
> > > > > > Hi,
> > > > > >
> > > > > > I don't know what I've done, but my combo boxes just stop
> functioning!
> > > > > (i.e.
> > > > > > when I click on the arrow, the list drops down, but when I try to
> > > select
> > > > > any
> > > > > > item, there's no responce at all - as if it is locked)
> > > > > >
> > > > > > I've checked its Lock and Enable properties, and Lock is no,
> Enable is
> > > > > yes.
> > > > > > Does anyone have any idea what's happening here?? Any suggestion
> is
> > > > > > appreciated.
> > > > > >
> > > > > > Regards,
> > > > > > Sam
> > > > >
> > > > >
> > >
> > >
>
>
.


Quantcast