Search results

  1. A

    Overriding Result of a Calculated Field Depending On Other Fields

    Apologies but I'm practically a beginner when it comes to Access, I just have the unfortunate distinction of knowing just that little bit more than anybody else and ergo it's all fallen to me. I'm sure that were any of you to look at how this form all works you'd be appalled. How would the...
  2. A

    Overriding Result of a Calculated Field Depending On Other Fields

    Hello all, I hope somebody will be able to help with this (and that I explain it in a way that makes sense). Back in August I was asked to design a form to allow my company's in-house quality assurance and coaching team to evaluate the level of service our customer service agents provide to...
  3. A

    Retrieve random record from table and populate fields based on criteria.

    Hello! Apologies it's taken a couple of days, haven't been near my work laptop all weekend. Thank you both for the help. It works brilliantly. :) I added in an After Insert action too to remove the chat from the list of possible chats to evaluate once done too so avoid any potential - though...
  4. A

    Retrieve random record from table and populate fields based on criteria.

    I was able to use your query: SELECT [ChatID],[Agent],[DateTime],[Duration] FROM tblChats WHERE ChatID = (GetRandomChat('tblChats' ,'John Doe')) ; And it ran without a problem and pulled one chat into a table. I can change the agent name to any other agent name and provided I Save + Close the...
  5. A

    Retrieve random record from table and populate fields based on criteria.

    I've put in your code and tried the form. Selected 'John Doe' from the dropdown and clicked my Get Chat button but it's now coming up with an error saying: Run-time error '3021': No current record. Immediate window says: SELECT [ChatID],[Agent],[DateTime],[Duration] FROM tblChats WHERE ChatID...
  6. A

    Retrieve random record from table and populate fields based on criteria.

    Does the agent name need to be hard coded? If so do I need to put in a lot of IIF formulae to say if it's John Doe use this code, if it's Jane Bloggs use this code or is there an alternative way? I've tried your code with my combo box dropdown of agent names but getting the same Syntax error...
  7. A

    Retrieve random record from table and populate fields based on criteria.

    Get an error saying: "Syntax error (missing operator) in query expression '[Duration] Where Chat_ID = (GetRandomChat('tblChats',"AGENT NAME");'. and in the Immediate window it has: SELECT [ChatID],[Agent],[DateTime],[Duration] Where Chat_ID = (GetRandomChat('tblChats' , "AGENT NAME") ; I've...
  8. A

    Retrieve random record from table and populate fields based on criteria.

    Functions Option Compare Database Option Explicit Public Function RandomNumber(Optional Lowest As Long = 1, Optional Highest As Long = 9999) ' Generates a random whole number within a given range Randomize (Timer) RandomNumber = Int(Rnd * (Highest + 1 - Lowest)) + Lowest End Function Public...
  9. A

    Retrieve random record from table and populate fields based on criteria.

    So how do I fix the Compile error that's occurring with the code? strSQL="SELECT [ChatID],[Agent],[DateTime],[Duration],GetRandomChat(" & chr(34) & tblChats & Chr(34) & ") As Expr1 From tblChats where Agent =" chr(34) & me.cboAgent.Column(1) & chr(34) & " Order By 5;" Sorry to keep being a...
  10. A

    Retrieve random record from table and populate fields based on criteria.

    I took the quotation marks away from tblChats but still got the same error. I then took the quotations away from Agent =" chr(34) & me.cboAgent.Column(1) & chr(34) & " Order By 5 but I'm not getting a new error: Run-time error '3075' Syntax error (missing operator) in query expression 'Agent =...
  11. A

    Retrieve random record from table and populate fields based on criteria.

    The message box I get up says "Compile error: Expected: end of statement". cboAgent did have 2 columns too so I changed the code as you advised to: strSQL="SELECT [ChatID],[Agent],[DateTime],[Duration],GetRandomChat(" & chr(34) & "tblChats" & Chr(34) & ") As Expr1 From tblChats where Agent ="...
  12. A

    Retrieve random record from table and populate fields based on criteria.

    I changed it to: strSQL="SELECT [ChatID],[Agent],[DateTime],[Duration],GetRandomChat(" & chr(34) & "tblChats" & Chr(34) & ") As Expr1 From tblChats where Agent =" chr(34) & me.cboAgent & chr(34) & " Order By 5;"
  13. A

    Retrieve random record from table and populate fields based on criteria.

    I'm getting an Expected: End of Statement error with this. Sorry to be such a pain!
  14. A

    Retrieve random record from table and populate fields based on criteria.

    I have the Immediate window open but nothing shows in it.
  15. A

    Retrieve random record from table and populate fields based on criteria.

    I've removed the line you said and added in the Debug.Print but it didn't bring up my SQL query. When I click my Get Chat button it keeps pulling the same chat through each time regardless of the agent I've selected from the dropdown.
  16. A

    Retrieve random record from table and populate fields based on criteria.

    It's called cboAgent. I changed the "cmbAgent" in the code to "cboAgent". Full code as I have it is: Private Sub buttonGetChat_Click() Dim rs As DAO.Recordset Dim strSQL As String strSQL = "SELECT [ChatID],[Agent],[DateTime],[Duration],GetRandomChat(" & Chr(34) & "tblChats" & Chr(34) &...
  17. A

    Retrieve random record from table and populate fields based on criteria.

    Hi. I've put the module and on click codes in as you've suggested but it's still changing the Agent. If I select Jane Doe and click Get Chat it's changing to Joe Bloggs and pulling a Joe Bloggs chat through.
  18. A

    Retrieve random record from table and populate fields based on criteria.

    Hello, hoping somebody will be able to offer some further assistance. I'm using this code and it's pulling chat details from my table but it's changing the Agent as well. What I'm hoping to have is that I can choose a particular agent from a list (for arguments sake let's call him "Joe...
  19. A

    Retrieve random record from table and populate fields based on criteria.

    Thank you both for the help, I'll try them in the morning and report back! :)
  20. A

    Retrieve random record from table and populate fields based on criteria.

    Hello all. Hoping somebody here will be able to guide me in this endeavour. I work for a retailer and am currently trying to create a database and front-end form for our Quality and Coaching team to use when assessing our customer service staff - in this instance it's a web chat team that...
Top Bottom