Search results

  1. C

    How to write IIF() in INSERT INTO statement

    I just noticed in your code you only have IsNull([Forms]![frmLog].[Total Talk Time CCEC subform]) - this would only refer to the subform, you need to refer to the actual textbox on the subform that you want to check the value of. '"'" & IIf(IsNull([Forms]![frmLog].[Total Talk Time CCEC...
  2. C

    Selecting "variable" columns

    Glad I could help.
  3. C

    Question about Update Queries

    If it is a new record, as in it has not been entered in the database before, you would use an INSERT query. If the record has just been entered and you want to change some of the details, you could attempt to get the primary key and then use an UPDATE query. To refer to a specific record, you...
  4. C

    OpenReport But All Records Show Up

    Glad I could help.
  5. C

    Best way to automate clicking a form button

    Does the form actually contain any information required to send the emails or is it only used to Click the button? If you only click the button to send emails, I would place the same code in a Function that can be run each time the database opens. You store the date each time the function runs...
  6. C

    OpenReport But All Records Show Up

    The query behind the report is the same as the one behind the form? I would also try and build a query that returns the rows you expect, even if you place a patientID and date directly in the query criteria, just to make sure there are no strange joins that are adding duplicate rows.
  7. C

    OpenReport But All Records Show Up

    How many records have the same date as [StartDate]=[Forms]![NewPatientForm]![NIASubForm].[Form]![StartDate] ? Try and create a query first, using the Build expression (right mouse on the criteria line for StartDate) to point to the subform and check how many results come back. Also, as per...
  8. C

    REWARD-Is this even possible? Auto-Schedule

    Yes, you can certainly add a cascading delete relationship between the tables, as this will ensure that records get deleted from AuditYears, when the parent record in AuditBranch is deleted.
  9. C

    Question about Update Queries

    As the name suggests, UPDATE queries, update existing records in your database. You can build them using the Access query builder - so in Access 2003 you follow these rough steps create a new query add to this query the table you want to update from the query menu choose "Update Query" you will...
  10. C

    REWARD-Is this even possible? Auto-Schedule

    The query will still work, but what you want to do is add a new record for each year, rather than adding the years into the same record. I actually made the AuditYear field in the table AuditYears only 4 characters long so that it would only hold one year. For example, I added three new rows...
  11. C

    Selecting "variable" columns

    Is there any logic behind which columns a particular Rep has the values stored in? For instance, why does Rep 1 have values in Qual-02 & Qual-04 but Rep 2, has values in Qual-02 &+ Qual-03? Yet no records use Qual-01 or Qual-05? If there is no particular logic, you might have to utilise IIF...
  12. C

    OpenReport But All Records Show Up

    You need to add a date criteria to your WHERE clause. At the moment it is only filtering based on Patient_Last_Name, which is why you get all the records. If you want to filter also by the date you should add something like AND...
  13. C

    How to write IIF() in INSERT INTO statement

    As for Banana's comments, the ppint of this post is to create a SQL string in VBA and as such anything outside the actual SQL string, such " & Me.Forms![MyParentForm]![MyParentFormControl] & " is VBA code and only the results of the call are sent in the SQL string. In the case of this post...
  14. C

    How to write IIF() in INSERT INTO statement

    Sorry, only got back to the forum and saw your posts. This should be an easy fix, replace the Is Null part of your IIF with either = Null, or IsNull(value). "'" & IIf(IsNull([Forms]![frmLog].[Total Talk Time CCEC subform]), "00:00:00", [Forms]![frmLog]![Total Talk Time CCEC...
  15. C

    How to write IIF() in INSERT INTO statement

    Since you are already using code, why don't you use the If..then..else statement you already have and assign the result to a local variable NCalls, which you can refer to in your SQL string? That is, use NCalls instead of Me.[minCalls] in your query. Otherwise you could utilise the usual IIF...
  16. C

    Send Access reports in email with Security Warning

    Using the Outlook application object in Acccess you can try saving the messages as Drafts, instead of sending straight away. It is then a fairly easy task to send the messages from the outlook drafts folder. Alternatively, using an application like, Mike375 suggested, is also an option. From...
  17. C

    how to bring value of query to table?

    Sorry, I should have clarified that it was only pseudo-code. Your query string does not contain any line break so it needs to either be all on one line, or you can add the line breaks to improve readability. Also make sure you use the syntax " & me.[Fieldname] & " when referring to the fields in...
  18. C

    Combining multiple rows into one row in SQL

    Mat, Thanks for posting the updated code, I had not thought of declaring the values for the parameters with rsQuery![Forms!project!projID] = Forms![Project]![projID]. Man, now I have to go and rewrite all those functions where I created the recordset based on a SQL string with the values from...
  19. C

    REWARD-Is this even possible? Auto-Schedule

    Hi andrew, No need for the reward - why not give it to a worthy cause. Just happy to help. Maybe you can shout me a beer next time I am in Canada - which is a pretty safe deal since I was last there about 15 years ago:)
  20. C

    Continuous form bug

    Do you programmatically unlock the description textbox at any stage? For example, does the code running when you click the date text box have anything like txtDescription.Enabled = True, or txtDescription.Locked = False. Also it would be worth checking the properties of the description text...
Back
Top Bottom