UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

> Fetching Values From A Record To Place In Form Textboxes    
 
   
absoprob
post Mar 30 2012, 04:44 AM
Post #1

UtterAccess Enthusiast
Posts: 69



Hi,

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 (IMG:style_emoticons/default/smile.gif)

Ap
Go to the top of the page
 
+

Posts in this topic


Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 22nd May 2013 - 11:35 PM