On an Access Form used to enter supplier invoices, when a SupplierID is selected in one textbox and 'focus' goes elsewhere I'd like default data from related fields in my tblSuppliers table to appear in corresponding textboxes.
So for instance, in tblSuppliers, the record for SupplierID 200 has a DefaultTaxCode of 5 and a DefaultProjectCode of 07.1.
On Lost Focus when a SupplierID has been selected (from a dropdown menu of valid SupplierIDs) I'd like to see the value 5 appear in the textbox 'txtTaxCode' and 07.1 appear in the textbox 'ProjectCode'. Of course the user has the option of leaving these as they are or changing them as necessary before submitting the record.
I know how to set the 'On Lost Focus' to trigger the code.
I know how, in the VBA Code window, to set the value of a textbox to something such as the value of another textbox or a default value.
I also know how, in the VBA Code window, to take the value of a textbox and to use DoCmd.RunSQL to Insert it into a database.
Is it just as simple to obtain the values of fields from a record in my tblSuppliers so they appear on the form?
Any assistance appreciated