You can use Chr(34) (") to help, like this.
Call Shell(SysCmd(acSysCmdAccessDir) & "msaccess.exe " & Chr(34) & "F:\Pooka\I like Rabbits.mdb" & Chr(34)
Application.FollowHyperlink Chr(34) & "F:\Pooka\I like Rabbits.mdb" & Chr(34)
Here are some more.
1. Add OLE Objects into a db. If you embed pictures or documents to a db, the size will be increased in no time.
2. Open 97 db in 2000 or higher without converting it. This will add some features in so you can open a 97 db in a higher version without a prompt for options...
You can try
name = CurrentProject.Path & "\export"
CurrentProject.Path is available for Access 2K or higher.
If you use Access 97, try this instead.
name = fRelativePath & "export"
You'll need the fRelativePath function to help.
Function fRelativePath() As String
Dim strCurName As...
If you know the server name you can use Net Time to help.
If you want to set the current machine time to the server time, type this in command promt:
Net Time \\computer_name /set /yes
Learn more about the parameters, type Net Time /? in the command promt.
So I guess the zqryPriorScore query is not yet parameterized. To do so, in the Query Design view, go to Query menu>Parameters>type in Workunit in Parameter column and select Integer in Data type column.
And change the function from:
Function FishPriority(iWorkUnitID As Integer) As Recordset...
Your code should work out well. Why don't you feed a fixed value to replace the OpenArgs like this.
Private Sub Form_Open(Cancel As Integer)
Set Me.Recordset = FishPriority(1)
End Sub
You can use DateDiff() like this on the past1 and past2
=DateDiff("yyyy",-2, Me.date_received)
=DateDiff("yyyy",-1, Me.date_received)
But you don't need to store calculated fields. You can create them on-fly in a query.
Why don't you just delete the file itself?
Or just replace it with a new file with the same name like this.
Private Sub ReplaceOldFile()
Open "c:\text1.txt" For Output As #1
Close #1
End Sub
The syntax for VBA Name statement is
Name OldFileNameWithPath As NewFileNameWithPath
Now what you have to do is open the table as a recordset and loop thru the records and change the files name.
Private Sub ChangeFilesName()
Dim dbs As Object, rst As Object
Dim strPath As String...
Are you going to use a check box control for the Yes/No field? When you create a form based on a Yes/No field, Microsoft Access uses a check box control as the default control for the Yes/No data type. Predefined and custom formats are ignored when a check box control is used. Therefore, these...
Try this code on other db.
Private Sub DeleteTable()
Dim dbs As Database
Set dbs = OpenDatabase("c:\yourtargetdb.mdb")
On Error Resume Next
dbs.TableDefs.Delete "Table1 "
dbs.Close
Set dbs = Nothing
End Sub