Jump to content

M4A

Members
  • Content Count

    9
  • Joined

  • Last visited

Community Reputation

0 Neutral

About M4A

  • Rank
    Newbie
  1. Hi, i have 2 access tables orders & Items, both tables have a field OrderID, I sucessfully managed to create a drop down list of the items on the orders form but i need to fill in the filter field to filter the drop down to show only items where ordersID is equal iv tried and tried to no avail. The tables are in access. I use aspmaker to generate front end. I am trying to fill out the SQL filter field. the example in aspmaker shows:ew_IIf(AField.CurrentValue & "" <> "", "`ALookupTableField` = " & AField.CurrentValue, "") so i wrote:ew_IIf(OrderID.CurrentValue & "" <> "", "`OrderID` = " & OrderID.CurrentValue, "") The tables are in access. I use aspmaker to generate front end. I am trying to fill out the SQL filter field. The example i have to work on is ew_IIf(AField.CurrentValue & "" <> "", "`ALookupTableField` = " & AField.CurrentValue, "")both values are adInteger, where am i going wrong?
  2. If i have 3 tables: MASTER|DETAIL|DETAIL2 with 3 fields: ID|Title|Budget all the same.How do i make the master table budget field be calculated from the other 2? e.g. Master.Budget=Detail.Budget+Detail2.Budget I,v completely lost track. All I Need is that little snippet and ill be able to write all the calculations
  3. To be honest my aspmaker trial just ran out an hour ago im just about to buy liscence for $200 then i'll note the error message.I,v only got 36 hrs to finish it. Cheers for your help
  4. Hello again, ok i tried to get the SQL right first in access to put into the VB. I got this to work: SELECT Sum([ViewDetails1]![baseline Budget]+[ViewDetails2]![baseline Budget]) AS Expr1FROM ViewDetails1, ViewDetails2; ' Then this: INSERT INTO [WH-Budget] ( [baseline Budget] )SELECT Sum([ViewDetails1]![baseline Budget]+[ViewDetails2]![baseline Budget]) AS Expr1FROM ViewDetails1, ViewDetails2; But NOT this: .Function Row_Inserting(rsold, rsnew) If Not EW_DEBUG_ENABLED Then On Error Resume Next ew_Execute("INSERT INTO [WH-Budget] ( [baseline Budget] ) SELECT Sum([ViewDetails1]![baseline Budget]+[ViewDetails2]![baseline Budget]) FROM ViewDetails1, ViewDetails2 WHERE [WH-Budget].[WBS ELEMENT]=Viewdetails1.[Master ELEMENT] AND [WH-Budget].[WBS ELEMENT]=Viewdetails2.[Master ELEMENT];") Row_Inserting = TrueEnd Function Do you think i am going about this project the wrong way or Would this "once completed" Be an adequette way of making a web based, drill down table?
  5. Hi iv been trying and trying, i think this is the closest i came: ' Page Load eventSub Page_Load() Dim v1, v2, v3v1 = ViewDetails1.[baseline budget]v2 = ViewDetails2.[baseline budget]v3 = v1 + v2ew_Execute("UPDATE [WH-Budget] SET [baseline budget] = " & v3 & " WHERE [WH-Budget].[WBS Element] = ViewDetails1.[Master Element];")End Sub but i recieve this error: Error Type:Microsoft VBScript runtime (0x800A01B6)Object doesn't support this property or method: 'ViewDetails1.Baseline budget'/project9/WH2DBudgetlist.asp, line 1942I have been through the database and checked all the field types. I'v tried changing field types putting default values in.Where am i goig wrong?
  6. Hi, I have a relatively simple database consisting of 5 Tables WH-Budget(Master), ViewDetails1, ViewDetails2, ect.... WH-Budget is master to viewdetails1, viewdetails1 is master to viewdetails2, Viewdetails2 is master to viewdetails3 and viewdetails3 is master to viewdetails4. The Master is set out as: ID | WBS Element | Baseline Budget | Revised Cost | Revised Saving | Variance | Ordered | Invioced | And the 4 detail pages are as: ID | Master Element | Parent Element | WBS Element | Baseline Budget | Revised Cost | Revised Saving | Variance | Ordered | Invioced | The purpose of my Database is to be a budget planner for a project.I run my access database through aspmaker using an extension (Previewrow) that allows me to drill down into the master detail, with a nice front end. The relationships work fine : [WH-Budget].[WBS Element]-->Viewdetails1.[Parent Element]Viewdetails1.[WBS Element]-->Viewdetails2.[Parent Element]and [WH-Budget].[WBS Element] is the [Master Element] for Viewdetails 1, 2, 3 & 4 The part i am stuck on is calculating the fields in the database. I need all the fields in the Master table to be calculated from the four detail pages e.g.[WH-Budget].[baseline Budget] = Viewdetails1.[baseline Budget] + Viewdetails2.[baseline Budget] + Viewdetails3.[baseline Budget] + Viewdetails4.[baseline Budget] and i need to do this for each field in the master table apart from the [WBS Element] I am inserting the SQL in the events, I have tried and tried but to no avail. Here's a snippet: ' Page Load eventSub Page_Load()Dim SELECTSQLa, SELECTSQLb, v3 v3 = (SELECTSQLa) + (SELECTSQLb) SELECTSQLa = ("SELECT [baseline Budget] FROM ViewDetails1;") SELECTSQLb = ("SELECT [baseline Budget] FROM ViewDetails2;")ew_Execute(SELECTSQLa)ew_Execute(SELECTSQLb)ew_Execute("UPDATE [WH-Budget] SET [baseline Budget]=" & v3 & ";")End Sub I know this looks pretty messed up and miles away, but all the things i thought would of worked i tried the first 200 attempts: i started off with..... Dim v1, v2, v3v1 = ... ' Budget 1v2 = ... ' Budget 2v3 = v1 + v2ew_Execute("UPDATE <Table> SET <Field> = ' & v3 & " WHERE <condition>") ......and got very lost. I realise this will need many queries, but i cant get it started. Please You Clever People, Share your knowledge with me and i will be eternally gratefull.
  7. I got it working! heres the code: ' Row Inserted eventSub Row_Inserted(rsold, rsnew)Dim InsertSQL, LotNo, BlockNo, iLotNo = RsNew("LotNumber")BlockNo = RsNew("NoofBlocks")For i = 1 to BlockNo InsertSQL = ("INSERT INTO reelers (LotNumber, NoofBlocks, [Part Number], [Lot Qty], Description, [Manual Lot Number], Notes) SELECT " & LotNo & ", NoofBlocks, [Part Number], [Lot Qty], Description, [Manual Lot Number],Notes FROM reelersinput;")ew_Execute(InsertSQL) LotNo = LotNo + 1NextEnd Sub
  8. ' Row Inserted eventSub Row_Inserted(rsold, rsnew)Dim InsertSQLInsertSQL = ("INSERT INTO reelers (LotNumbers, [Part Number], [Lot Qty], Description, [Manual Lot Number], Notes) SELECT FirstLotNumber, [Part Number], [Lot Qty], Description, [Manual Lot Number],Notes FROM reelersinput;")Dim ResultResult = ew_Execute(InsertSQL)End Sub
  9. Hi all, i have a simple DB with 2 tables:Table1.....ID|1st Lot No|No of Blocks|Part Number|Date|Lot Qty.Table2.....ID|---------Lot No-----------|Part Number|Date|Lot Qty.What im trying to achieve is When the user inputs values in Table1, the data is pulled through to Table2, but i need the value in [Table2,Lot No] to auto increment Based on the Table1.No of blocks.e.g. User inputs:ID|1st Lot No|No of Blocks|Part Number|Date |Lot Qty.1 | 62204 | 6 | TR456 |1/1/12|2.978KMThen when Table1 Row_inserted, Table2 is auto updated to:ID| Lot No|Part Number|Date |Lot Qty1 |62204 | TR456 |1/1/12 |2.978KM2 |62205 | TR456 |1/1/12 |2.978KM3 |62206 | TR456 |1/1/12 |2.978KM4 |62207 | TR456 |1/1/12 |2.978KM5 |62208 | TR456 |1/1/12 |2.978KM6 |62209 | TR456 |1/1/12 |2.978KMI am using aspmaker and putting the code in the server event:' Row Inserted eventSub Row_Inserted(rsold, rsnew) End SubI have been trying to achieve this using dims, insert into, i'v done numerouse tutorials and i just cant get it to work. My sql knowledge is moderate. But i'v been stuck on this for about 200hrs NO JOKE, i dont like giving up.Please If anyone has the skills to show me the way, then i would greatly appreciate your help.Regards, Mike.
×
×
  • Create New...