I looked at faq702-4289 and although I understand the concept, I cannot make it work in my application.
(Access 2003 front end-back end config)
The data to show on the form is generated by the query qry_frm_audit_info and the record is to be selected as follow
CCAN is the unique ID.
audit_no is an autogenerated #
The Combo box code is now as follow:
(User select the custoemr name and the matching CCAN select the reorf on the form)
RowSource: SELECT qry_frm_audit_info.cust_name, qry_frm_audit_info.ccan FROM qry_frm_audit_info GROUP BY qry_frm_audit_info.cust_name, qry_frm_audit_info.ccan ORDER BY qry_frm_audit_info.cust_name;
AfterUpdate(): Private Sub Combo44_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[cust_name] = '" & Me![Combo44] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
As it stands now, if a CCAN has multiple audit_#, only the 1st one shows on the form.
Possible solution I think of but cant program:
Include in the RowSource of the combobox qry_frm_audit_info.cust_name.audit_# then the use will be able to see the audit_no in the combobox (3 columns) and
and amend the following to include audit_no?
rs.FindFirst "[cust_name] = '" & Me![Combo44] & "'"
Is this possible? If not then I will have to go to 2 combo box where the 1st one will select the CCAN and the 2nd one the audit_no.
Any ideas are very welcomed.
Thanks in advance
(Access 2003 front end-back end config)
The data to show on the form is generated by the query qry_frm_audit_info and the record is to be selected as follow
CCAN is the unique ID.
audit_no is an autogenerated #
The Combo box code is now as follow:
(User select the custoemr name and the matching CCAN select the reorf on the form)
RowSource: SELECT qry_frm_audit_info.cust_name, qry_frm_audit_info.ccan FROM qry_frm_audit_info GROUP BY qry_frm_audit_info.cust_name, qry_frm_audit_info.ccan ORDER BY qry_frm_audit_info.cust_name;
AfterUpdate(): Private Sub Combo44_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[cust_name] = '" & Me![Combo44] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
As it stands now, if a CCAN has multiple audit_#, only the 1st one shows on the form.
Possible solution I think of but cant program:
Include in the RowSource of the combobox qry_frm_audit_info.cust_name.audit_# then the use will be able to see the audit_no in the combobox (3 columns) and
and amend the following to include audit_no?
rs.FindFirst "[cust_name] = '" & Me![Combo44] & "'"
Is this possible? If not then I will have to go to 2 combo box where the 1st one will select the CCAN and the 2nd one the audit_no.
Any ideas are very welcomed.
Thanks in advance