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
[QUOTE="Jeff Boyce"]
Sam
Are the combo boxes bound or unbound?
--
Good luck
Jeff Boyce
<Access MVP>
where
the of
my
[/QUOTE][/QUOTE]