|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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- |
|
#3
|
||||
|
||||
|
[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 |
|
#4
|
|||
|
|||
|
Thanks ............ I think I see what you mean, I'll set about giving it a go.
Thanks - I'll post my results :-) |
|
#5
|
|||
|
|||
|
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 |
|
#6
|
|||
|
|||
|
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- |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Simple form subform problems |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|