Afternoon,
Minutes should be formated as nn. Try this
format(now(),"YYYYMMDDHHNNSS") & "_HOLDING"
it will return:
20030903172429_HOLDING
Cheers
bruce
Jasonmac,
I have to do the the same sort of thing. I have included a function which I use.
'===================================
'Create tblInvoiceNo with 2 fields
'Invoice_No = LONG
'Date = DATE/TIME
'Call the function from your report e.g. =fncInvoiceNo
'Each time you call it you will get a...
Create a new query and paste this SQL in then Run it.
SELECT tblU.FILENAME INTO tblUNION
FROM tblU INNER JOIN tblSUB ON tblU.FILENAME = tblSUB.FILENAME ;
Here is the code.
Public Sub subQueryReplace()
'=============================================
Dim strSQLIn As String
Dim strSQLOut As String
Dim db As DATABASE
Dim qd As QueryDef
Dim rs As Recordset
Set db = CurrentDb...
Mikeyboy,
Try this function which you can call from your query:
Public Function fncCountField(strSentence As String, strSearch As String) As Long
Dim intPos As Integer 'You position within the string
If Len(fncCountField) = 0 Or Len(strSentence) = 0 Then
fncCountField = 0...
Give these a crack,
SELECT Clng(PE) AS PEnumber 'Converts to long
SELECT Cdbl(Pe) AS PEnumber 'Converts to double
SELECT Cint(PE) AS PEnumber 'Converts to integer
Cheers
Try this:
dim strSQL as string
strSQL = "(UPDATE tblM) SET TransactionDate = "
strSQL = strSQL & [Forms]![frmCompanyinfo]![StartDate]
strSQL = strSQL & " WHERE TNo = '4';"
DoCmd.RunSQL strSQL
'Note you may have to put #'s around your start date
Cheers
Bruce
...two thumbs up to.
Create a query which you will base your report on and paste this SQL into your query:
SELECT MSysObjects.Name,
DCount("*",[Name]) AS recordcount
FROM MSysObjects
WHERE (((MSysObjects.Type) In (1,6))
AND ((Left([name],4))<>"MSys"));
This will give you...
Steve,
Try this.
Select Case strValue
Case 1 , 2 ,12 '<------this doesn't seem to work
' --do these lines of code--
Case 3 to 6
'--do these lines of code
End Select
All the best
B.
...to your live database
6a. Create query qryBACKUP_DATATACKING
INSERT INTO tblBACKUP_DataTracking_tb ( ARCHIVE_TIMESTAMP )
SELECT Now() AS Expr1, *
FROM DataTracking_tb;
6b. do the same for the other table
7a Create query qryDELETE_DATATRACKING
DELETE * FROM DataTracking_tb
7b Do the same...
...DoCmd.SetWarnings False
'Create a new backup table
'--------------------------
DoCmd.RunSQL "SELECT Now() AS ARCHIVE_STAMP, * INTO tblBACKUP_" & !Name & "_" & format(date(),'YYYYMMDD') & " IN 'C:\BACKUP\BACKUP.mdb' FROM " & !Name
'clear local table...
Sorry,
I forgot that you want to delete your source data.
add this line AFTER the first DOCMD.RUNSQL
DoCmd.RunSQL "DELETE * FROM " & !Name
B.
...With rs
Do While Not .EOF
DoCmd.SetWarnings False
DoCmd.RunSQL "SELECT Now() AS ARCHIVE_STAMP, * INTO tblBACKUP_" & !Name & " FROM " & !Name
DoCmd.SetWarnings True
.MoveNext
Loop
End With
End Sub
Hope it...
Josh,
Have you tried replacing your YES,NO,TRUE,FALSE with -1 and 0. I have had problems along these lines before.
I also assume qrySelectedTrue runs independently of your subroutine?
B.
Tadynn,
Your Openreport statement should read like this:
DoCmd.OpenReport stDocName, acPreview,,"[OrderKey] " & fncInList("List0", 0)
Cheers
Bruce
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.