Are functions like Now() and Date() not supported in Access Run-time? My code works in regular Access; however, it errors out when executed on Run-time and this is the only reason I can fathom as to why this is happening.
You have a missing reference somewhere. This is a common problem. I have some code you can use to check your references at runtime, let me know if you want to use it.
I usually make a quick form with a listbox in it about 6" wide, and set the form as the startup form. Then set the listbox's properties as below:
[tt]
Row Source Type: Value List
Column Count : 3
Column Heads : No
Column Widths : 0.5;1
[/tt]
In the form's load event, add this line of code:
[tt]
Private Sub Form_Load()
Me.ListBox1.RowSource = GetReferences()
End Sub
[/tt]
That's it. Paste this code into a standard module, then when the database opens, the form will appear with the current state of all your references:
[tt]
Public Function GetReferences() As String
' Purpose: format a delimited string to
' use as a listbox rowsource.
On Error GoTo ErrHandler
Dim strStatus As String
Dim refItem As Reference
Dim strReferences As String
Dim strPath As String
Dim strName As String
For Each refItem In References
If IsError(refItem.Name) Then
strStatus = "BAD"
strName = ""
Else
strStatus = "OK"
strName = refItem.Name
End If
If IsError(refItem.FullPath) Then
strStatus = "BAD"
strPath = ""
Else
strStatus = "OK"
strPath = refItem.FullPath
End If
If refItem.IsBroken Then strStatus = "BAD"
strReferences = strReferences & strStatus & _
";" & strName & ";" & strPath & ";"
Next refItem
GetReferences = strReferences
ExitHere:
Exit Function
ErrHandler:
Debug.Print Err, Err.Description
Resume ExitHere
End Function
[/tt]
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.