Hi Guys,
I'm using the code below to rank groups of records in a query:
SELECT A.[Pay Number], A.[NI Number], A.[Contracted Hours], Count(*) AS Rank
FROM tbl1 AS A LEFT JOIN tbl1 AS B ON (A.[Contracted Hours]<= B.[Contracted Hours]) AND (A.[NI Number] = B.[NI Number])
GROUP BY A.[Pay Number]...
Hi I’m creating a query with code and attaching a where statement (strwhere2) to get information from 2 text boxes into the criteria of the field [Date Received].
strSQL = "SELECT CoverTable.Ref, LocumRequestInformation.Contact, CoverTable.Available, LocumRequestInformation.Hospital...
Hi Guys,
I have the following code to merge a word document and the results of a query (code and Job Title) which works fine.
Set WordApp = New Word.Application
If (Me.TxtQA.Value = "Safe Increase") Or (Me.TxtQA.Value = "Unsafe Increase") Then
Set WordDoc =...
Hi,
I need to remove part of a code in a field so that I can compare the rest with another code "PTB69REV1". The part I want to remove is always at the end but has a number that will always increase, ie, Rev, Rev1, Rev2, Rev3 up to Rev12 at the moment.
I have tried to replace the end of the...
Hi Guys,
I would like to delete an import error report table after my spreadsheet is imported but I am getting an syntax error message, can anyone see why?
If TableExists("'Progress to Assim$'_ImportErrors") Then
DoCmd.RunSQL "DROP TABLE 'Progress to Assim$'_ImportErrors; "...
Hi Guys,
How do I do more than 1 replace in a column, I've tried various versions of this:
REPLACE(dbo.tbltruststaff.JobFamily, 'Nursing / Midwifery', 'Nursing and Midwifery') & REPLACE(dbo.tbltruststaff.JobFamily, 'Nursing/Midwifery', 'Nursing and Midwifery')
but cant find the right syntax.
Hi Guys,
I’m new to foxpro so please forgiven my lack of understanding.
I have pieced together the following code from other processes in our system so that I can open a letter with the record set of a query and then write to a table that the letters have been sent.
It works fine if it’s run...
Hi Guys,
I want to use echo on/off around my code on a form but after it's complete the screen is frozen and I need to close the database.
DoCmd.Echo True, "Updating..."
docmd."Bit of code"
DoCmd.Echo False, "Done"
I have tried repaint, repaintobject, refresh but nothing works.
Does...
Hi,
I have some animation code that works well from the on timer event of the form but is running constantly.
What I would like to do is turn it on and off from a command button, does anyone know how I could do this?
Thanks in advance.
' code for animation
Static sintPic As Integer...
Hi,
I have a form with 4 buttons that I import large files from excel or run modules that do some table comparisons.
Each of these routines takes time to run and if the user clicks the mouse while running access stops responding.
Is there a way to disable the mouse and also bring accesses on...
Hi Guys,
I'm trying to change the names of 3 tables with the following code but I'm getting this error message "Item not found in this collection"
Option Compare Database
Option Explicit
Function RenameTables()
Dim db As DAO.Database
Set db = CurrentDb
Debug.Print...
Hi Guys,
I found this code to compare tables in my database and it works great untill it hits this records when I get an error message:
"syntax error (missing operator) in query expression ''O'Neill ');'."
Can anyone see where the problem is?
thanks in advance.
Sub...
Hi Guy's,
I'm trying to send a table to my server with this SQL code but i get an error message "Expected:=" can anyone see where i have went wrong?
Function ODBCConnect()
Dim strSQl As String
strSQl = "SELECT * INTO [C:\Documents and Settings\Tom\Desktop].[tbltemp] " & _...
Hi Guys,
I just converted my first (.mdb) file to a (.adp) but all my stored procedures show a message after running:
"The store procedure executed properly but did not return any records."
this happens when I click to open the procedure, but I get an run-time error message ('8008') when I...
Hi Guy's,
I am trying to open a mail merge file with the following code:
Dim oApp As Object
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
'Open the document.
oApp.Documents.Open ("H:\UserName\Review Letter.doc")
the word document opens fine...
Hi Guys,
I'm having problems with a union query. I can't get it to group in the way that I want, here is the sql of the 2 queries:
QueryMainReport1
SELECT QueryRecordSource.Group, tblStaffGroup.StaffGroup, Count(QueryRecordSource.[Pay Number]) AS Staff, Sum(IIf(tblKSF.KSF,1,0)) AS KSF1...
Hi guys,
I'm trying to set the record source for my main form and search within a subform, from a command button on the main form, to find a record but I am getting a type mismatch error with this code:
Private Sub Command10_Click()
On Error GoTo Err_Command10_Click
Dim frm1 As Form...
Hi Guys,
This query works fine if there is only one record in tblRecSource but is there a way to do it if there are more than one
SELECT StaffList.[Division code], *
FROM StaffList
WHERE (((StaffList.[Division code])=DLookUp("ServiceCode","tblRecSource")));
or is there another way to do the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.