Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. jabenj

    Select Query with Sum formula from multiple tables

    Got it to work: stSql = "SELECT Sum([TransferredWeight]) - Sum(Weight) AS currentweight" _ & " FROM tblLatexBatchQC INNER JOIN [Blendsheet Output]" _&"ON tblLatexBatchQC.TankNum = [Blendsheet Output].TankN Where [Blendsheet Output].TankN = '" & Me!cmbTankNum & "'" Needed the where clause to...
  2. jabenj

    Select Query with Sum formula from multiple tables

    Thanks. I'll keep plugging away. SQL pane says: Compile error, Variable not yet created in this context I defined the currentweight variable so I'm not sure what exactly it's talking about
  3. jabenj

    Select Query with Sum formula from multiple tables

    No. Keep getting same error messages as before. Depending on how I arrange code keep getting: No value given for one or more required parameters Or Run time Error - The select statement includes a reserved word or an argument name that is mispelled or missing, or the...
  4. jabenj

    Select Query with Sum formula from multiple tables

    Tried this way also and didn't work stSql = "SELECT Sum([TransferredWeight]) - Sum(Weight) From tblLatexBatchQC, [Blendsheet Output] AS currentweight" stSql = stSql & " WHERE tblLatexBatchQC.[TankNum] = [Blendsheet Output].TankN" & Me.cmbTankNum & "" Set rs =...
  5. jabenj

    Select Query with Sum formula from multiple tables

    Can someone please let me know why this isn't working? I'm trying to take the difference of two fields from two separate spreadsheets. I believe it's only reading from the first spreadsheet (tlbLatexBatch QC) and not the other. Any help would be greatly appreciated. Dim con As Object...
  6. jabenj

    Select statement, multiple tables

    Thanks for the help. I tried that and now I get another message saying no value given for one or more parameters. Haven't had a chance to play with it yet to figure out why. I'm guessing something missing in my table or a problem with one of my variables.
  7. jabenj

    Select statement, multiple tables

    Once again I'm stuck. Shocker. I'm trying to take data from multiple tables and Sum them. I think what I have should work, but I keep getting a runtime error 2465 saying the field "'" can't be found. Do I need to do a join statement? Help is appreciated. Thanks Dim con As Object Dim...
  8. jabenj

    Select Query with IF THen statement

    I gave up on this some time ago but revisited it recently and with some help got the solution. The problem was that the Dcount function does not read Null values; it skips over it. The following finally worked: Dim i As Integer i = DCount("*", "[Blendsheet Input]", "TankNum ='" &...
  9. jabenj

    Query most recent record

    Hi. Any help would be greatly appreciated. I'm trying to query my database for the most recent record for a tank specified by the user on a form. I have an If then statement based on that query as shown below: If DCount("LotNum", "[Blendsheet Input]", "TankNum ='" & Me.cmbTankNum & "'") =...
  10. jabenj

    Select Query with IF THen statement

    Get the same problem. Maybe I need to include a time stamp so the If statement can query the most recent entry for a specific tank
  11. jabenj

    Select Query with IF THen statement

    Yes the same TankNum can be displayed for multiple rows in the table and that's the problem. Ultimately, I want the correct text to be displayed if any "LotNum" field value associated with a specific TankNum does not contain a text (or is null). I originally tried: If [LotNum] = Null Then...
  12. jabenj

    Select Query with IF THen statement

    Thanks for Help! The "If rs![LotNum] = True Then" statement kind of worked. However now it seems that even though the value is "True" in a couple scenarios, the correct If statement isn't executed. I am running this code from a form in access (running query in form). I can not add the...
  13. jabenj

    Select Query with IF THen statement

    Hi All, What I'm trying to do seems simple enough yet I can't get it to work. I am querying a database and I want a text to display based on my IF Then statement. However, it seems as though my select query is only reading my most recent value in my table instead of the select values...
  14. jabenj

    Message based on select query

    Thanks for the help. I'm getting the message on the line: stSql = stSql & " WHERE [TankNum] = '" & cboTankNum.Value & "'" I tried changing to rs![LotNum] but didn't work. I think it may have something to do wit the way I'm defining the variable "lotn" but i'm not sure
  15. jabenj

    Message based on select query

    Thanks in advance for any help. I'm trying to do something that should be simple enough but it's not working. I'm trying to display a text in a field based on a select query. If a value exists in a field in my database (LotNum in Blendsheet input), then i want my text box on a form to say...
  16. jabenj

    Formatting of query results

    Yes. Records distinct to each table on separate rows. Tried a union query. Couldn't get it to work. Maybe i was doing someting wrong. But is a union query what i need?
  17. jabenj

    Formatting of query results

    Hi All. I made an INNER JOIN query that returns entries from two tables that are related by a common Lot#. So I want the query to record all entries, from two tables that are related to a Lot# that the user enters. I was able to do this, however, the query returns duplicate entries. It's...
  18. jabenj

    Updating empty field in access table with text

    Thanks all for help. I got it to work. The problem was that "txtLotNum" was a bounded field. I changed it to an unbounded text and it works now. Thanks
  19. jabenj

    Updating empty field in access table with text

    Thanks for your help. cboTankNum.Value is a combo box that is selected by the user in the form to update the appropriate table row. I only wanted the row to update if the LotNum field did not have a value. If the LotNum field contains a value, this means it was updated before and shouldn't be...
  20. jabenj

    Updating empty field in access table with text

    Hi. I'm a novice trying to update a field (LotNum) in an access table (Product Input) using an update statement. I'm updating through a form that the user fills out under two conditions: 1. the LotNum field is empty, and 2. the appropriate tank is selected. First I was getting a Write...

Part and Inventory Search

Back
Top