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 18th, 2004, 11:11 AM
peteshepherd peteshepherd is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 3 peteshepherd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Angry Simple form subform problems

Hi! yes another total beginner with Access!

Help! I've tried and tried but to no success. I have a form with a subform in it. At the top of my form I have a combo box which contains customer names, selecting one then populates the sub form (continuous) with that customers orders. My problem is I have a text box on the top of the main form into which I want to enter a number (consignment note No) and click a button I then want this number to appear in a similar box that is next to each line in the sub form, and when I click save to be added to the table (tbljobdets) in the consignmentno field. Does that make sense? At the same time there is a check box YES/NO next to each line in the sub form which I would want to be selected as YES. Once all done I would then select another name in the combo box and do the same again. Sounds crazy (does it?) but this is what I need to do. My main frm is based on tblcustomers and the sub form on tbljobdets and that's it.

Any help much appreciated

Last edited by peteshepherd : February 18th, 2004 at 11:17 AM. Reason: Didin't look right

Reply With Quote
  #2  
Old February 18th, 2004, 02:21 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: 13
It sound like you are just trying to update existing records. If that is the case, don't waste you time with Form/subfrom.

Create an update query that does what you want it to do the will be based on information you enter in your main form, from which you will also execute the query

S-

Reply With Quote
  #3  
Old February 18th, 2004, 02:36 PM
supersubra's Avatar
supersubra supersubra is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Coimbatore, India
Posts: 280 supersubra User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 15 m 10 sec
Reputation Power: 6
[Create a Temporary table named Temptbljobdets with similar structure to tbljobdets (with one more to hold consignment note no) and use this temp table as record
source for subform. then in afterupdate event of combo box which contains customer names
place this code
docmd.setwarnings false
docmd.runsql "Delete * from Temptbljobdets"
docmd.runsql "Insert into Temptbljobdets Select
tblobdets.*, " & me!yourenteredno & " From tbljobdets where
tbljobdets.customername = '" & yourcustcombox.value & "'"
me!subformname.requery
docmd.setwarnings true

If you are going to add new record to subform then you may have to add this event also on one of the subforms maincontrol afterupdate event

me!subformconsignmentnotenocontrolname = forms!parentformname!consignmentnoteno


then on accept you can push the temp table data into tbljobdets by insert query after deleting already existing records for this combination.

Hope i have not confused you.
__________________
V.Subramanian

Reply With Quote
  #4  
Old February 19th, 2004, 04:35 AM
peteshepherd peteshepherd is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 3 peteshepherd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks ............ I think I see what you mean, I'll set about giving it a go.

Thanks - I'll post my results :-)

Reply With Quote
  #5  
Old February 19th, 2004, 07:22 AM
peteshepherd peteshepherd is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 3 peteshepherd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks and thanks again sbaxter .......... the update query has achieved exactly what I wanted and I've learned a bunch of new stuff (again).
I had a bit of a battle getting the query to do what I wanted, and almost gave in and asked again .... but then out of the blue I managed.
So - on to the next bit now .......... let's hope I can manage without having to ask.

Thanks again

Reply With Quote
  #6  
Old February 19th, 2004, 11:15 AM
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: 13
It's Okay to ask. It doesn't mater how much we know there is always something we don't know how to do.

S-

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Simple form subform problems


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
Stay green...Green IT