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 February 10th, 2004, 08:20 PM
musicfanz musicfanz is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 64 musicfanz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Exclamation Updating corresponding field in table

Hi all,

With respect to the previous thread that was posted, there's a problem. From the subform (parts_sent_info), we have the combo box (part no) to lookup the weight from the table (weight_of_parts). I need to capture this weight in 2 tables, "Order_fulfulment"(which constitutes the main form) and "parts_sent_info". But the corresponding entries in these 2 tables for the field "weight" is not updated.

Anyone who can help?

Regards,
Tracy

Reply With Quote
  #2  
Old February 11th, 2004, 01:37 AM
TBÁrpi's Avatar
TBÁrpi TBÁrpi is offline
Lazy User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Hungary, Europe
Posts: 337 TBÁrpi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 5 m 5 sec
Reputation Power: 5
Send a message via MSN to TBÁrpi Send a message via Yahoo to TBÁrpi Send a message via Skype to TBÁrpi
You have several options to write the data into the table.
Use the OnChange or AfterUpdate events of the combo and using DAO or SQL you can write the value you selected from th combo, into the table.
Knowing the field names i can be more specific.
__________________
BRegs,
TBÁrpi
"I can only show you the door. You're the one who has to walk through it."

Reply With Quote
  #3  
Old February 11th, 2004, 02:42 AM
musicfanz musicfanz is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 64 musicfanz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
I managed to come up with an update query to update the field "weight" in the table "Parts_sent_info".

In the subform (Parts_sent_info subform), the fields are:
PacRef(not visible), No, PartSentNo, Weight, Quantity

with a command button that runs the update query which goes like this:

UPDATE PARTS_SENT_INFO, ORDER_FULFULMENT, WEIGHT_OF_PARTS SET PARTS_SENT_INFO.WEIGHT = [FORMS]![PARTS_SENT_INFO_SUBFORM]!WEIGHT
WHERE ([PARTS_SENT_INFO].[PARTSENTNO]=[FORMS]!PARTS_SENT_INFO_SUBFORM!PARTSENTNO And [FORMS]![PARTS_SENT_INFO_SUBFORM]!PARTSENTNO=[WEIGHT_OF_PARTS].[PARTNO]);

It works fine...it's just that whenever i click on the command button, it pops out a window for me to input the [FORMS]![PARTS_SENT_INFO_SUBFORM]!WEIGHT and another popup to input FORMS]!PARTS_SENT_INFO_SUBFORM!PARTSENTNO.

Why is this so? And how do i change this query in order to have it updated automatically once the command button is clicked?

Regards,
Tracy

Reply With Quote
  #4  
Old February 11th, 2004, 04:45 AM
TBÁrpi's Avatar
TBÁrpi TBÁrpi is offline
Lazy User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Hungary, Europe
Posts: 337 TBÁrpi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 5 m 5 sec
Reputation Power: 5
Send a message via MSN to TBÁrpi Send a message via Yahoo to TBÁrpi Send a message via Skype to TBÁrpi
Refer the subform's control like this:
Me.[subform_control_name].Form.[control_name]
where:
- 'Me' is the keyword referring the current (parent) form the code belongs to
- [subform_control_name] is the name of the subform control on your parent form
- [control_name] is the name of the control on your subform referred by [subform_control_name].
Example:
If the name of the subform control on your parent form is 'Parts_sent_info_subform' then:
Me.Parts_sent_info_subform.Form.WEIGHT
In your SQL statement, you need to concatenate the SQL keywords with the VALUES eld by the controls, and NOT with the controls themselves.
To concatenate them, use the '&' operator.
The '&' operator is used for string concatenation. See Help for more information on using the '&' operator.

Last edited by TBÁrpi : February 11th, 2004 at 04:48 AM.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Updating corresponding field in table


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 6 hosted by Hostway