Search results

  1. A

    VBA Insert Into SQL help

    I have tried the following, but as the code breaks at mySQL2 beofre the debug.print, i cant get it to display in the window?? mySQL2 = "INSERT INTO [tblReceive] (OrderDetailFK, Qty, DateReceived, UserFK, ReceiveFK) VALUES (" & _ Me.OrderDetailFK & ", " & minusNum & ", " & "Now()" & ", " &...
  2. A

    VBA Insert Into SQL help

    I have a simular SQL which uses now() and it works fine, i did try the update just incase but i still get the same error.
  3. A

    VBA Insert Into SQL help

    I have the following SQL string that i want to run, but i get an application or object defined error. Can anyone notice a mistake with my string? mySQL2 = "INSERT INTO [tblReceive] (OrderDetailFK, Qty, DateReceived, UserFK, ReceiveFK) VALUES (" & _ Me.OrderDetailFK & ", " & minusNum & "...
  4. A

    Loop recordset with IF greater than?

    thank you for your help, i managed to get it to work with this code Private Sub txtQty_AfterUpdate() Dim areYouSure As String Dim mySQL As String Dim mySQL2 As String Dim minusNum As Integer If Me.Qty > Nz(DLookup("[RemainingQty]", "tblQtySoFarTEMP", "[OrderDetailPK]= " & Me.OrderDetailFK))...
  5. A

    Loop recordset with IF greater than?

    I have updated the qty see bellow, i can get the code to trigger once. Just thinking about it, i dont actually need it to loop through i only need it to look at the current value!! and if the condition is true to run an update query.
  6. A

    Loop recordset with IF greater than?

    Its more than one but there is probably a maximum of 20 records at one time in the temp table, that i want to parse through?
  7. A

    Loop recordset with IF greater than?

    Thank you for the replies, what i want to do is check the qty in the text box with a value in a temp table( this holds the remaining qty for each item) I want to Ask a vbyesno message eventually that asks if they want to update the original order Qty if the total received qty is more than the...
  8. A

    Loop recordset with IF greater than?

    Im trying to create a record set that compares a quantity value in the recordset to a Value in a temporary table that holds the most recent remaining quantity. I have the following code in the after update of a text box, but it does not trigger. I want it to run after a value is entered into the...
  9. A

    Update query Criteria

    I have the following update query, im a little stuck in formatting my WHERE clause. I only want it to run an update if ALL the records in tblOrderDetail.StatusFK = 2. Currently it runs if only one has StatusFK = 2. Im sure its simple but cannot figure it out. UPDATE (tblOrder INNER JOIN...
  10. A

    help with my recordsetcode

    Ha i have heard Dlookup is a bad habit!, but the table its looking up is a temp so there are only a maximum of 15 lines, so i am hoping Dlookup should be fine to use. the val was an error and i have deleted that line now, All points noted i will try and get into the habit of indenting, it...
  11. A

    help with my recordsetcode

    This has been solved i made a quick change to the Qty format and it seems to have done the trick Dim val As Integer Dim rs As DAO.Recordset Set rs = Forms!frmReceive!sfrmReceiveDetailEntry.Form.RecordsetClone With rs Do While Not rs.EOF rs.Edit val = Nz(DLookup("[RemainingQty]"...
  12. A

    help with my recordsetcode

    thank you for your suggestion, i have tried putting it directly into the field but its still not working? do you think i may need to do something in SQL?
  13. A

    help with my recordsetcode

    Im trying to get a recordset loop code working, i have my bellow code which keeps inputing a zero. My second piece of code is identical code but displaying the qty in a message box. The number it is displaying is the number i want to input into my field. I just cant seem to get it to put the...
  14. A

    Help with recordsets

    I appreciate your help, i have used your idea to create the bellow code, The code runs with no errors, but it's only putting zero's in table? so it runs a query to make sure the latest vales are in the temp table. And them im trying to lookup the value from the table? DoCmd.OpenQuery...
  15. A

    Help with recordsets

    The tables are not linked as its only a TempTable, as every time the query runs it replaces the table. But the ReceiveDetailPK are in both tables, is that any help?
  16. A

    Help with recordsets

    nope i want it to find the remaining qty for each record in a table called tblQtySoFarTEMP( this table keeps a running total of the total qty for each item. As for example an order with the qty of 50, could already been received 2 times, 1st time = 3, 2nd time = 10. So in tblQtySoFarTemp...
  17. A

    Help with recordsets

    i will try! i have the following code that makes all quantities 0 before running any other code. This is basically what i want to do but rather than put a zero. i want to basically lookup the remaining qty for each record and update the record. I'm just not sure how to put that into code...
  18. A

    Help with recordsets

    Hi, I need to loop through and edit a subform. The subform is for receiving an order, i want to run a receive all with a button click. So i have a query that works out what is remaining, i then want to update the qty in the subform with the remaining qty. I have tried several ways with no joy...
  19. A

    Run Update query on each line of continuous form

    i have the following update query, that i want to run on each record in the recordset, when the OrderdetailFK from the recordset equals the OrderdetailFK in a table? UPDATE (tblOrderDetail INNER JOIN tblQtySoFarTEMP ON tblOrderDetail.OrderDetailPK = tblQtySoFarTEMP.OrderDetailPK) LEFT JOIN...
  20. A

    Run Update query on each line of continuous form

    Hi There, i have set up an update query. is there a way of looping through a continuous form record set and running the update on each line?
Back
Top Bottom