Search results

  1. S

    Else without IF error

    Don't I feel like a dunderhead! That is precisely the problem. Thank you so kindly! :D
  2. S

    Else without IF error

    Hello experts, I'm trying to write a function that will check if a record exists, update if so, insert if not. For some reason when I test this I get an "Else without If" error. There is clearly an IF statement at the top, so I'm a little flummoxed about why. Any ideas? Private Sub...
  3. S

    Delete Record From Another Database Based on Form Field Value

    Greetings Experts, I have two associated DB's that share info. While working in database A, I'd like to be able to find, delete & replace the associated record in database B. I have a form in database A that holds a value I'd like to pass to database B in order to do this. I can't seem to...
  4. S

    .RecordCount funtion not giving expected results

    MarkK, this seems to have done the trick. Thank you a million times, you are a genius!
  5. S

    .RecordCount funtion not giving expected results

    Tried both suggestions. Debug.Print on IDJan gives me "1" Changing to Forms!frmMain.cmboYear does not correct the problem.
  6. S

    .RecordCount funtion not giving expected results

    Update - I tried this, but am still getting "1" Public Function GetIdentity() Dim rst As Recordset Dim IDJan as Integer Set rst = CurrentDb.OpenRecordset("SELECT Count(tblRecords.ID) AS CountOfID " _ & "FROM tblRecords " _ & "GROUP BY tblRecords.ExecYear...
  7. S

    .RecordCount funtion not giving expected results

    I'm afraid not. It contains sensitive information that cannot be publicly shared.
  8. S

    .RecordCount funtion not giving expected results

    Thank you, but I have already tried this. When I put the SELECT statement in the SQL query builder, I get 3 as I expect. Any other thoughts?
  9. S

    .RecordCount funtion not giving expected results

    GetIdentity is called in the On_Load event of my report, it populates the text boxes with the variable values. It's working fine with recordsets that have no results, but with this one, which should have 3, it's only displaying a "1" When I try rst!CountofID, I get a "no current record" error...
  10. S

    .RecordCount funtion not giving expected results

    Thank you kindly, but I am still getting a "1" result from this :(
  11. S

    .RecordCount funtion not giving expected results

    Hello Experts, I have the below function passing a value to a variable that is used to populate an unbound text field on a report. For some reason, the result I'm getting is "1" instead of the expected number. It seems the function is only counting the first record in the recordset. Any idea...
  12. S

    Case Statement within "INSERT INTO" Query?

    Thanks, this helpful. Will this work if there is more than a one for one option? To specify, if someone's POB is CA, NY, CT, ND, etc. I want the field to display "USA" If someone's born in PRI, GUAM, etc it will display something different. Would SWITCH work in this scenario?
  13. S

    Case Statement within "INSERT INTO" Query?

    Can you please explain how you would use a SWITCH statement here? I have never used one and wouldn't even know how to begin. Thank you :)
  14. S

    Case Statement within "INSERT INTO" Query?

    Greetings Experts: I am using the below SQL statement to pull a record from one database and insert it into another. I need to be able to update the column POBSort with one of three possible options based on the place of birth that's being displayed on a user subform. I have done some...
  15. S

    Extra Zeros When Adding Variable Values

    All, I was able to figure this out. I was trying to add up so many variables that I had four lines of code and was joining them with "&" symbols - the report was treating each line as a separate calculation. I broke down the sets into smaller variables, added those up and got the "2" total I...
  16. S

    Extra Zeros When Adding Variable Values

    Thank you for this, but I'm afraid when I do this I get "2000" now! There are many more variables involved than what I have listed in my example. Other thoughts?
  17. S

    Extra Zeros When Adding Variable Values

    Hello experts, I have a report that pulls data based on several SELECT statements into recordsets, counts the records in the sets and saves that count in INTEGER variables. I am attempting to design an unbound control on my report that adds up the values of these variables to display a total...
  18. S

    Conditional Formatting?

    Hi all, I'm afraid this didn't work either. The report is applying the formatting to every record regardless of the value. :banghead:
  19. S

    Conditional Formatting Based on Timestamp

    Anyone? I tried the solution suggested but nothing. I'm desperate!
  20. S

    Conditional Formatting Based on Timestamp

    Not quite. The date portion of the field is a range that falls within the critera of the query my report is based on. I don't care what the date is; I only care if the time portion of the field is before 6am or after 6pm.
Back
Top Bottom