Search results

  1. A

    DCount Syntax w/ Autonumber

    Ahha! You are always a ginormous help. Thanks again. Here is what it converted to for anyone that may stumble on this thread: DoCmd.RunSQL "UPDATE TBL_ACTION SET [ActionEntity] = '" & Me.CustomerOwed & "' , [Action] = ""IN"", [Qty] = " & Me.PaybackLevel & ", [StockType] = '" & Me.StockType & "'...
  2. A

    DCount Syntax w/ Autonumber

    Sorry not sure what you are saying. How does this relate to this or the rest of it?: WHERE PaybackRecordID = " & Me.RecordID & " AND ActionEntity = '" & Me.Borrower & "';" I have for number fields " & Me.NumberField & " And for text fields '" & Me.TextField & "' And for straight Text ""Text""...
  3. A

    DCount Syntax w/ Autonumber

    That did it. But now that my UPDATE is firing I am getting a syntax error. Do you see it? ActionEntity = Text Action = Text Qty = Number StockType = Text TimeStamp = Date/Time Notes = Text
  4. A

    DCount Syntax w/ Autonumber

    I have a button event that fires A SQL INSERT if the DCount is 0 and fires SQL UPDATE if DCount is 2. Something is wrong with the syntax because my INSERT will fire initially but upon a 2nd attempt it will not fire the UPDATE but rather the INSERT again even though there is RecordID that matches...
  5. A

    Can't Get Form to Close

    I have a form I want to close but somehow the codes running before it cancel it out before my closing code can run. Here is the full code for the form. 'Check for Null Fields If IsNull(Me.cmb_to_customer) Or IsNull(Me.cmb_from_customer) Then MsgBox ("Please enter a TO CUSTOMER and FROM CUSTOMER...
  6. A

    Nested DLookup in SQL UPDATE

    I have a nested DLookup in a SQL UPDATE that is not working. The DLookup has an "AND" in the WHERE Statement as well. I cannot figure out the problem. I got a type mismatch with this code and when I take out the single quotes I do not get an error message but the data is not updated in the...
  7. A

    Subtract Query Help

    I created a new query using your SQL and it is working great! I am going to just use this. Thank you soooo much for your help.
  8. A

    Error Message On Creating Duplicate Record

    Here is something that uses DCount to see if there is already a record: 'Will Not Check a Null Field If Not IsNull(textbox) Then 'Will Check There is Already a Record If DCount("Field", "TABLE", "Field = '" & Textbox & "'") = 1 Then MsgBox "If there is already a record then this message fires...
  9. A

    Subtract Query Help

    Thanks for the reply. IN: SELECT QRY_SUM_ACTIONS.ActionEntity, QRY_SUM_ACTIONS.Action, QRY_SUM_ACTIONS.SumOfQty, QRY_SUM_ACTIONS.StockType FROM QRY_SUM_ACTIONS WHERE (((QRY_SUM_ACTIONS.Action)="IN")); OUT: SELECT QRY_SUM_ACTIONS.ActionEntity, QRY_SUM_ACTIONS.Action, QRY_SUM_ACTIONS.SumOfQty...
  10. A

    Subtract Query Help

    I have a battery inventory DB I am working on. The instances are recorded as "IN" or "OUT" and there is a quantity connected to each record/instance. I need a query to subtract the quantity of "IN's" from "OUT's" based on the CustomerID. Currently I have made a totals query for Each "IN" and...
  11. A

    DLookup Problem

    Yes that was it. I think it was too close to see. haha. Thanks again!
  12. A

    DLookup Problem

    My problem is that I am trying to fire a warning message to prevent invalid TechID's from being SQL Inserted into a table and this "IF" statement is not firing. I think it must have to do with the "Left" statement because all of my other statements fire. Any help would be appreciated. If...
  13. A

    Problem w/ DLookup in INSERT Statement

    Yes it works now. I did what you said but I was working with a test table and I did not populate that field so it inserted Null. I feel like forum village idiot. Thanks so much for your help. You are a life saver. Cheers!
  14. A

    Problem w/ DLookup in INSERT Statement

    Thanks for the reply! EquipmentDescription is text and I tried single quotes around the value and it outputs to the table ( & lookModType1 &) in that field. I tried with the debug and in the line it gave me for that value the barcode I entered. I tried other ways and the only other output in the...
  15. A

    Problem w/ DLookup in INSERT Statement

    I need my INSERT statement to DLookup tbl_module_repairs and insert the information from a field based on a WHERE condition of primary key matching on the form and table. Here is what I have but it will not work on the last value: Dim lookModType1 As Variant lookModType1 =...
  16. A

    Open a Form on a Record Problem

    Works Great! Thanks a million.
  17. A

    Open a Form on a Record Problem

    I need to open a Form based on the text box of another form. The problem is that the Record ID field I need to open the 2nd form on is not able to be altered and is not locked. So the 1st form text box that holds the Record ID is (txt_rid1) Unbound and the 2nd form field is a text box (prikey)...
  18. A

    Getting Values from a Combo Box

    Ok, solved my own problem. I will show what I did for people who may find this in the future. First I added code to the row source of my combo box under profile types in the query builder: [Forms]![FRM_RF_OUTBOUND_PRICING].[txt_customer1] Then I added code to the After Update event of that...
  19. A

    Getting Values from a Combo Box

    I have created a form with unbound text boxes and the user can apply prices based on DLookup of a table with prices in it. Here is the code that does that: Case "Line Extender" strCriteria = "repair_item = 'Line Extender Repair' AND profile_types = 'Alpha'" .txt_rate1 =...
  20. A

    Check for Duplicates in Unbound Text Boxes

    Thanks for the reply. The user is entering record id's into unbound text boxes and I do not want them to enter the same record id as it when the submission is made my SQL update code is executed and that would leave one record not updated and the one in there twice updated as the last SQL to run...
Back
Top Bottom