A form opens with a combobox, textbox, and label button. The combobox window drops down showing the choices available, but when someone actually clicks on a choice it does not fill in the combobox.
Here is the code behind the form:
Private Sub Form_Activate()
DoCmd.SelectObject A_FORM, "FRM-CodeCombo"
DoCmd.Restore
End Sub
'FRM-CodeCombo is the name of the form opening.
Private Sub Form_Load()
Me![CodeComboBox].SetFocus
Me![CodeComboBox].Dropdown
End Sub
'CodeComboBox is the name of the combobox.
'Allows the selection of the combobox to open a query which will supply the information to the report.
Private Sub btnPrint_Click()
DoCmd.OpenReport "RPT-CodeDates", acViewPreview
Me!btnPrint.SpecialEffect = 2
Me!btnPrint.SpecialEffect = 1
End Sub
Private Sub btnPrint_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me!btnPrint.SpecialEffect = 2
End Sub
Private Sub btnPrint_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me!btnPrint.SpecialEffect = 1
End Sub
In the properties of the combobox:
Control Source is blank
Row Source Type is Table/Query
Row Source is 'QRY-Code' which is correct.
Column count is 2.
Column Heads is No
Bound Column is 1.
Limit to List is Yes.
If there is a property I did not show here that is important please let me know.
So, why will it not allow a selection to be made from the dropdown of the combobox? Thanks, JL
Here is the code behind the form:
Private Sub Form_Activate()
DoCmd.SelectObject A_FORM, "FRM-CodeCombo"
DoCmd.Restore
End Sub
'FRM-CodeCombo is the name of the form opening.
Private Sub Form_Load()
Me![CodeComboBox].SetFocus
Me![CodeComboBox].Dropdown
End Sub
'CodeComboBox is the name of the combobox.
'Allows the selection of the combobox to open a query which will supply the information to the report.
Private Sub btnPrint_Click()
DoCmd.OpenReport "RPT-CodeDates", acViewPreview
Me!btnPrint.SpecialEffect = 2
Me!btnPrint.SpecialEffect = 1
End Sub
Private Sub btnPrint_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me!btnPrint.SpecialEffect = 2
End Sub
Private Sub btnPrint_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me!btnPrint.SpecialEffect = 1
End Sub
In the properties of the combobox:
Control Source is blank
Row Source Type is Table/Query
Row Source is 'QRY-Code' which is correct.
Column count is 2.
Column Heads is No
Bound Column is 1.
Limit to List is Yes.
If there is a property I did not show here that is important please let me know.
So, why will it not allow a selection to be made from the dropdown of the combobox? Thanks, JL