Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 3rd, 2003, 03:14 AM
nono270980 nono270980 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 69 nono270980 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Fields 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

Reply With Quote
  #2  
Old November 3rd, 2003, 03:47 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
Use an unbounded form

Use VB Code

When you click Update

Look to see if you branch already exists in the table then add or edit the record as needed.

I would suggest you use a combobox to have the user select an existing branch from the table and allow them to enter a branch that doesn't exist.


S-

Reply With Quote
  #3  
Old November 3rd, 2003, 10:43 PM
nono270980 nono270980 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 69 nono270980 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
hi, the is the whole scenario:

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 where there is no branch code included. 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??

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

Reply With Quote
  #4  
Old November 3rd, 2003, 11:09 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
I have included you DB back. Look at "quryMaster" in design view

You will have to add the "Where" portion

S-

Reply With Quote
  #5  
Old November 4th, 2003, 03:20 AM
nono270980 nono270980 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 69 nono270980 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
fields update

hi,

the method u taught me, i have tried but cannot work.
i have attached a db here for your reference. pls guide me along.

how can i display all the fields in the form?

pls advice
nono
Attached Files
File Type: zip customersearch.zip (88.9 KB, 231 views)

Reply With Quote
  #6  
Old November 4th, 2003, 10:25 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
You should rethink about how you editing your customer profile. You data structure is set up to have more then one account per customer and you form would only show one account per customer.
You really should set it up in a form - sub form enviroment (If you like bound forms) or another way altogether (mine preference, no bound forms).
Think about it.

S-

Reply With Quote
  #7  
Old November 5th, 2003, 12:27 AM
nono270980 nono270980 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 69 nono270980 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
hi,

i know what u mean and that is the reason why i have place the name, nric and the account no in the combo box for user to choose from. from here they can differentiate the name under which accountno and perform the search.

this is however the user requirement and hope that u can give me some guidelines.

pls advice
nono

Reply With Quote
  #8  
Old November 5th, 2003, 02:07 AM
nono270980 nono270980 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 69 nono270980 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
hi all,

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

Cheers!
nono

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Fields update


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway