Search results

  1. A

    Odd Behaviour of Int() in Function

    Funny how often problems stand on assumptions. I said that Currency type always displays the $ symbol because it does. In a report or form where the control is formatted as Currency. It never occurred to me that I could format the table field as Currency and the report control as something...
  2. A

    Odd Behaviour of Int() in Function

    Hi I am writing a financial database that tracks Stocks, Bonds and Cash in several currencies. To do this I have a table with a record for each transaction that includes a field for [Quantity]. I have another table with [CurrentValue] for each asset. Both of these are number - Double - 4...
  3. A

    Two Similar SQL select queries. Why does one not work?

    BoerBende Thanks -Sometimes the obvious stuff is the hardest to see. A/R
  4. A

    Good book to learn vba, sql and recordsets

    jDraw Sorry it took me so long to respond. Thanks a lot for the suggestions. I am, unfortunately, dealing with ultra slow internet here, but I am dying to have a look at that stuff when I get into Broadband country A/R
  5. A

    Two Similar SQL select queries. Why does one not work?

    Hi. I need to check if a recordset is empty. I did this once before, with much help from this forum, using the following SQL: sqlstr = "SELECT [fxXRate] FROM tblFXRates " & _ "WHERE fxDate= #" & dtSetDate & "# AND fxCurrency ='" & strCur & "'" Adapting this to my new, even...
  6. A

    Object Required Error Checking for Empty Recordset

    O.K. Got it. After getting the "Too Few Parameters" error I tried copying the SQL generated by the Debug.Print statement back into the Query Grid as SQL. That showed the problem to be the reference to the Selected field, which I had referenced as tblFXRates.fxXrate. The spelling of...
  7. A

    Object Required Error Checking for Empty Recordset

    Hi Arnegp Thanks for the suggestion. I tried that and now I get a different error. "Too Few Parameters expected 1" A/R
  8. A

    Object Required Error Checking for Empty Recordset

    Hi Still haven't gotten it sorted. When I run this with debug.print I get: SELECT fxXRate FROM tblFXRates WHERE fxDate=#02-17-2016# AND fxCurrency ='CAD' If I paste that into the query Grid as SQL it works fine. So, I'm really not understanding why I am getting the Object Required error...
  9. A

    Object Required Error Checking for Empty Recordset

    Hi I tried the following but am still getting the "Object Required" error on the line: Set rst = db.OpenRecordset(sqlstr) 'Check if Query for FX is empty i.e.,No exchange rate in table for this currency on this date Dim rst As Recordset Dim sqlstr As String sqlstr = "SELECT fxXRate...
  10. A

    Object Required Error Checking for Empty Recordset

    CJ_London and JHB Thanks. I think I actually get all that. I was using a form I made, from instructions by allen browne, that translates SQL to VBA and then trying to use it in SQL--Duuhh. That's also why the Carriage Return stuff is there. I'll get at this right away. This form's module...
  11. A

    Object Required Error Checking for Empty Recordset

    Hi I am soooooo close to getting this data entry form complete. The Database keeps track of transactions in bank accounts with differing currencies. The exchange rate between currencies is recorded in tblFXRates and I have to check, before adding a record to tblTransactions, using the data...
  12. A

    Good book to learn vba, sql and recordsets

    Hi After a couple of years of struggling I am getting pretty comfortable with basic Tables, Reports, Forms and Queries. I could really use a book that explains using VBA, SQL and Recordsets in Access. Any suggestions? Many thanks, as always. A/R
  13. A

    Function To Return Result of a Query

    Guus2005 That worked quite nicely. Thanks Again A/R
  14. A

    Function To Return Result of a Query

    Guus2005 Thanks for the comment I don't actually know what a "one liner" is and I'm not sure what "The first one" refers to. Forgive my inexperience. I noted that I included one line twice (commented). That was a leftover from an attempt to get it to work. I will try your suggestion and see...
  15. A

    Function To Return Result of a Query

    Hi I'll try and explain this in a simplistic way as I tend to overcomplicate my questions. I think my problem will be revealed quite readily by the code. I am trying to assign the result of a query to a variable so I can use it in a formula. From what I can gather this is possible by way of...
  16. A

    Unbound combobox column as query criteria

    Hi sneuburg Thanks for that. You've been quite helpful lately. I am aware of the hidden text box option, but thought it would be more elegant to reference the column directly. By the way; I tried every option of .Column(#) I could think of, obviously with no luck. Thanks again A/R
  17. A

    Unbound combobox column as query criteria

    Hi I know it is possible to use the bound column of a combobox control as criteria in a query, but can't figure out how to use an unbound column. Is this possible, and if so, what is the syntax? Thanks A/R
  18. A

    Do Calculation In Form Or Query

    Hi General question. If I want to populate a text box in a form, whose RecordSource is a query, with the result of a calculation. For example: Query Fields are [Quantity] and [Price] and I want the form to show [Quantity], [Price] and [TotalPrice]. Does it make any difference if I put an...
  19. A

    Function, with Recordset, In Combo Box

    Sneuberg It didn't take long to get the query to work! The two files you posted made it pretty simple. I don't know why I couldn't figure this out in the first place but no matter--it's working! Thanks Again AR
  20. A

    Function, with Recordset, In Combo Box

    Sneuberg Thanks for both of these really helpful replies. I did try to do it with a simple query but could not get it to work. I was not setting up the relationships properly. I think that your second post is probably the easiest way to approach this. However, as I mentioned it's a learning...
Top Bottom