P
Philip from Malta Europe
My form which is based on a query called frm-Curr(INVOICE), has two comdo
boxes apart from other fields. The first combo box named cmbTO when on click
gets down (lookup) data from a table call frm-Curr(T/OPERATORS) by field
Operator_ID, which has a list of operators and another combo box named
cmbCON, which is related, gets details from another table called
frm-Curr(CONTRACT) which has various unit lists per operator (can have
various units per operator) to get from it the filed called UnitRate. I
which that from the first combo cmbTO the field choosen from this combo is
transfered to the field to combo cmbCON which in turn lists all the related
units of the choosen OPERATOR field from the first combo box cmbTO.
I tried the flowing taken from The access Web:-
Private sub cmbTO_AfterUpdate()
Dim strSQL = strSQL As String
strSQL = "SELECT" & Me!cmbTO // combo box on click
strSQL = strSQL & "FORMS frm-Curr(INVOICE)" // name of form being used
Me!cmbCON.RowSourceType = "Table/Query"
Me!cmbCON.RowSource = strSQL // get from frm-Curr(CONTACT) details
Me!cmbCON.Requery
End Sub
Nothing happened and the combo cmbCON remind empty and when I click on the
combo box CONID all the units of all the people was given. When you have a
unit list of 500 this becomes imprecatable!!
In the combo box cmbCON I used an SQL query with the choosen fileds from
frm-Curr(CONTRACT) to get the required information re:UnitRate. In this SQL
query I used the Where cretaria [forms]![frm-Curr(INVOICE)].[cmbTO] so that
the combox cmbTO string will refer to this query. However this keeps on
popingup as soon as I open the form which is not what I want.
Also, when I input a new number in the combo cmbTO the combo cmbCON returns
the previous list which seems that the REQUERY statement in combo cmbTO is
not working even thought when I tried the SQL query direct from the combo
cmbCON it did work
Can any body help as I just cannot understand what I am doing wrong?
boxes apart from other fields. The first combo box named cmbTO when on click
gets down (lookup) data from a table call frm-Curr(T/OPERATORS) by field
Operator_ID, which has a list of operators and another combo box named
cmbCON, which is related, gets details from another table called
frm-Curr(CONTRACT) which has various unit lists per operator (can have
various units per operator) to get from it the filed called UnitRate. I
which that from the first combo cmbTO the field choosen from this combo is
transfered to the field to combo cmbCON which in turn lists all the related
units of the choosen OPERATOR field from the first combo box cmbTO.
I tried the flowing taken from The access Web:-
Private sub cmbTO_AfterUpdate()
Dim strSQL = strSQL As String
strSQL = "SELECT" & Me!cmbTO // combo box on click
strSQL = strSQL & "FORMS frm-Curr(INVOICE)" // name of form being used
Me!cmbCON.RowSourceType = "Table/Query"
Me!cmbCON.RowSource = strSQL // get from frm-Curr(CONTACT) details
Me!cmbCON.Requery
End Sub
Nothing happened and the combo cmbCON remind empty and when I click on the
combo box CONID all the units of all the people was given. When you have a
unit list of 500 this becomes imprecatable!!
In the combo box cmbCON I used an SQL query with the choosen fileds from
frm-Curr(CONTRACT) to get the required information re:UnitRate. In this SQL
query I used the Where cretaria [forms]![frm-Curr(INVOICE)].[cmbTO] so that
the combox cmbTO string will refer to this query. However this keeps on
popingup as soon as I open the form which is not what I want.
Also, when I input a new number in the combo cmbTO the combo cmbCON returns
the previous list which seems that the REQUERY statement in combo cmbTO is
not working even thought when I tried the SQL query direct from the combo
cmbCON it did work
Can any body help as I just cannot understand what I am doing wrong?