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...
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...
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...
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...
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...
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...
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...
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...
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...
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 =...
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 ="...
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;"
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.