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
Drop it into a new module. Then you can call it from anywhere.
However:
Monty has a cracking idea which I am prepared to give 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...
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.
OK,
Let forget the code. As you have to tables lets mak this very simple.
Steps:
1. Import both DataTracking_tb and AgentTrackingModification_tb into your backup database
2. Rename each table with a 'BACKUP_' prefix.
3. Add a field ARCHIVE_TIMESTAMP (as a date) to each table
4. Delete all the...
OK,
That code was part of one of my Libaries. It uses a pull technique to archive all tables linked to the db where it is being run.
A quick modification to a push technique and you will be laughing:
You will need to change 'C:\BACKUP\BACKUP.mdb' to the fully qualified path of your back up...
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.
Here is a module which will help you.
'==================================
'Goes through all access linked tables
'and creates a new backup table
'===================================
Public Sub subBACKUP()
Dim rs As Recordset
Dim db As Database
Set db = CurrentDb
Set rs =...
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.