Hi All,
I am developing a simple query builder which enables the user to create rules to automate data changes. When creating the criteria, the user selects a FieldName, Operator & Search value. The operators available are based on the Table.Def DataTypeName for each subform record. The following works, but there is a minor annoyance in that the user has to click on the Operator combobox twice to show the dropdown. I guess I'm using the wrong event.
Some detail:
Operator Combobox rowsource:
Control Events (ps_SQL = the above code):
The above ensures the Operator rowsource is correct when the FieldName is changed which works fine.
The above ensures the Operator rowsource is correct when the user jumps from one subform record to another by directly clicking on another records Operator combobox. Works, but user has to click twice.
There are no other events for these controls.
Can anyone advise why the user has to click twice?
Thanks
Tooley
I am developing a simple query builder which enables the user to create rules to automate data changes. When creating the criteria, the user selects a FieldName, Operator & Search value. The operators available are based on the Table.Def DataTypeName for each subform record. The following works, but there is a minor annoyance in that the user has to click on the Operator combobox twice to show the dropdown. I guess I'm using the wrong event.
Some detail:
Operator Combobox rowsource:
Code:
SELECT tblLULItms.ListItem, tblLULHdrs.ListName
FROM tblLookUpLists_Headers AS tblLULHdrs INNER JOIN tblLookUpLists_Items AS tblLULItms ON tblLULHdrs.LULH_ID = tblLULItms.LULH_ID
WHERE (((tblLULHdrs.ListName)=[Forms]![frmRules_Main_Rules]![frmRules_Sub_Criteria]![txtDataType]));
Control Events (ps_SQL = the above code):
Code:
Private Sub cboFieldName_Change()
With Me.cboOperator
.SetFocus
.RowSource = ps_SQL
.Value = "="
.Requery
.Dropdown
End With
End Sub
Code:
Private Sub cboOperator_GotFocus()
With Me.cboOperator
.RowSource = ps_SQL
.Value = "="
.Requery
End With
End Sub
There are no other events for these controls.
Can anyone advise why the user has to click twice?
Thanks
Tooley