Senin, 28 Desember 2015

Re: [MS_AccessPros] combo box to display required criteria on a Dialog Form

 

John,

Thank you for your reply. I will do the work at night and let you know tomorrow of the outcome. At the moment i am on job at some other place.

Thanks again,
Khalid


---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :

Khalid-

Put this in the SQL view of a new query:

SELECT DISTINCT Clients.ClientCIN, Clients.ClientName 
FROM CollectionVoucher INNER JOIN Clients 
ON Clients.ClientCIN = CollectionVoucher.ClientCIN 
WHERE CollectionVoucher.ConsignmentNo = 'AAA'
 ORDER BY Clients.ClientCIN"

Switch to Design view, add the Consignee table and make sure Access builds the correct relationship links, then add the field you need to the query grid.  Switch back to SQL view and use what you see to modify your code.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
http://www.viescas.com/ 
(Paris, France)



On Dec 28, 2015, at 10:41 AM, khalidtanweerburrah@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:



hi All,

I have a Dialog Form "Dialog Freight Invoice Selective Consignment-Client" having two unbound controls.

On first control "cmbConsignmentNo" After Update is:

Private Sub cmbConsignmentNo_AfterUpdate()

Me.cmbClientCIN.RowSource = "SELECT DISTINCT Clients.ClientCIN, Clients.ClientName " & _

                           "FROM CollectionVoucher INNER JOIN Clients " & _

                           "ON Clients.ClientCIN = CollectionVoucher.ClientCIN " & _

                           "WHERE CollectionVoucher.ConsignmentNo = '" & Nz(Me.cmbConsignmentNo, "") & _

                           "' ORDER BY Clients.ClientCIN"

End Sub

~~~~~~~~~~~~~

On the second control "cmbClientCIN" along with ClientCIN, ClientName I need to displayfield "ConsigneeName"

from the table "Consignee" having PK "ConsigneeID".

Table "CollectionVoucher" has the field "ConsigneeID".



How can the above After Update event be modified to display "ConsigneeName" in combox box ""cmbClientCIN".



Need help for this.

Regards,


Khalid







__._,_.___

Posted by: khalidtanweerburrah@yahoo.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)

.

__,_._,___

Tidak ada komentar:

Posting Komentar