Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old November 3rd, 2003, 05:35 AM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default fields from tables to update

hi all,

i have a form where there are fields like name, id (staff_table), Accountno (staff_Account_Table), branch code (Branch_Table) etc. they are from 3 different tables.

the form will have the branch code empty where the user will key in the branch code. i want the branch code and branch name to be reflected /updated into my account table once the user entered the branch code which means that the branch name will be updated automatically.

how can i do that???

pls advice
nono

  #2 (permalink)  
Old November 3rd, 2003, 10:38 AM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Location: Clarksville, TN, USA.
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Please provide table structure with complete PK/FK descriptions and relationships, IE One to Many.



Sal
  #3 (permalink)  
Old November 3rd, 2003, 10:35 PM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi,

in my branchtable, i have :
- branchCode (pk)
- branchName

in my staff_table, i have : (these are the fields that will be on my main form)
- staff id
- name
- contact no

in my staff_account_table , i have : (these are the fields in my subform)
- accountno
- account type
- branchcode (link to branchtable - fk)
- salary
- staffid (link to staff_table- fk)

i have another form that displays all the information on this staff when they select from the combo box. the form include fields of :
- staffid
- name
- contactno
- branchName (from branchtable)
- accountno
- account type
- salary

how can i display the all this information in my form. how can i link all these 3 tables to display the info?? how can i retrieve the branch code of the staff and display it as branch name in this form??

this is what i have done: under the record source of my form, i place this codings

SELECT staff_Table.staffid, staff_Table.name, staff_Table.[contact no], staff_account_Table.[account no], staff_account_Table.[account type] , staff_account_Table.[salary] FROM staff_Table INNER JOIN staff_Account_Table ON staff_Table.staffid = staff_Account_Table.staffid WHERE (((staff_Table.staffid)=Forms!frmSearch!cboSelectG roup));

how can i display the branch name???

pls advice
nono
  #4 (permalink)  
Old November 5th, 2003, 04:07 AM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi all,

the problem is solved by using DLookup.
Your help is greatly appreciated.

Cheers!
nono



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to match data in all fields in 2 tables sunny76 Access 0 April 14th, 2008 09:03 PM
Compare two fields from different tables pallone SQL Server 2000 10 March 23rd, 2007 05:14 PM
Blank fields - queries with many tables dvarrin Crystal Reports 0 February 1st, 2005 05:43 AM
Attaching objects to ole fields in tables william.murray BOOK: Access 2003 VBA Programmer's Reference 0 December 8th, 2004 08:21 AM
Pooling fields from two tables into one view eoffshore SQL Language 4 August 2nd, 2004 05:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.