Cosmos75
Registered User.
- Local time
- Today, 11:44
- Joined
- Apr 22, 2002
- Messages
- 1,281
I’ve developed a database in Access 97 that works on my computer (Win 2000, Access 97 and Access 2000).
When I brought it over to user’s computer (Win 98 & Access 97) I had a bunch of code that wouldn’t work. It was simple code as well.
Examples with problem bolded;
1. A textbox with this as the Control Source
=Month(Date())
2.TextBox on report
Format([UsageDay],"mmmm - yyyy")
- I think that anywhere I have Format(), it doesn’t work!!
3. Return to new line in MsgBox
- Chr(13) will give an error if I use it to go to the next line in a msgbox. Will have to try vbCrLf or VbNewLine.
4. Button to save a report as a snapshot file
As a side note on #2, there was a problem with =Format$([UsageDay],"mmmm yyyy",0,0) is a textbox on a report on the user’s computer, when they’d try to run the report, it would ask the user to enter the parameter Format$??. Added the MSCAL.ocx (Microsoft Calendar Control 8.0) file and reference fixed that but the date would not show up properly. (Thanks to pdx_man for that tip). I think IT was supposed to register that (via command prompt with regsvr32 Mscal.ocx) but not sure if they ever got to it. I’ll have that checked.
Has anyone come across this problem? I originally developed the db in Acc97 when I had Win98 as my OS so I don’t see a big difference between the computers.
This is the order and file location of the references for my code. The user’s computer also has this order. But keep in mind that the calendar control may not be registered.
Visual Basic for Applications – c:\Program Files\Common Files\Microsoft Shared\VBA\vba332.dll
Microsoft Access 8.0 Object Library – c:\Program Files\office97\Office\MSACC8.OLB
OLE Automation – c:\WinNT\System32\STDOLE2.TLB
Microsoft DAO 2.5/3.51 Compatibility Library – c:\Program Files\Common Files\Microsoft Shared\DAO\DAO2535.TLB
Microsoft ActiveX Data Objects 2.1 Library – c:\Program Files\Common Files\System\ADO\msado21.tlb
Microsoft Calendar Control 8.0 – C:\WinNT\System32\MSCAL.OCX
Snapshot Viewer Control – c:\PROGRA~1\COMMON~\System\SNAPVIEW.OCX
EDIT: I did not use any kind of packaging program. Just copied my files (Split Db) to their computer.
When I brought it over to user’s computer (Win 98 & Access 97) I had a bunch of code that wouldn’t work. It was simple code as well.
Examples with problem bolded;
1. A textbox with this as the Control Source
=Month(Date())
2.TextBox on report
Format([UsageDay],"mmmm - yyyy")
- I think that anywhere I have Format(), it doesn’t work!!
3. Return to new line in MsgBox
- Chr(13) will give an error if I use it to go to the next line in a msgbox. Will have to try vbCrLf or VbNewLine.
4. Button to save a report as a snapshot file
Code:
Dim ReportName As String
Dim ReportDate As String
Dim FileName As String
ReportName = "Report ("
ReportDate = Me.txtMonth & "-" & Me.txtDay & "-" & Me.txtYear & ")"
FileName = ReportName & ReportDate
Dim sngStart As Variant
Dim sngEnd As Variant
Dim sngElapsed As Variant
‘Get Start Time
sngStart = Timer
stDocName = "rptNewCoatingLetter"
DoCmd.OutputTo acOutputReport, stDocName, "SnapshotFormat(*.snp)",_
[b]Left[/b](CurrentDb.Name, Len(CurrentDb.Name) - Len(Dir(CurrentDb.Name)))_
& "Notification Letters\" & FileName & ".snp", True
‘Get end time.
sngEnd = Timer
' Elapsed time.
sngElapsed = [b]Format[/b](sngEnd - sngStart, "Fixed")
As a side note on #2, there was a problem with =Format$([UsageDay],"mmmm yyyy",0,0) is a textbox on a report on the user’s computer, when they’d try to run the report, it would ask the user to enter the parameter Format$??. Added the MSCAL.ocx (Microsoft Calendar Control 8.0) file and reference fixed that but the date would not show up properly. (Thanks to pdx_man for that tip). I think IT was supposed to register that (via command prompt with regsvr32 Mscal.ocx) but not sure if they ever got to it. I’ll have that checked.
Has anyone come across this problem? I originally developed the db in Acc97 when I had Win98 as my OS so I don’t see a big difference between the computers.
This is the order and file location of the references for my code. The user’s computer also has this order. But keep in mind that the calendar control may not be registered.
Visual Basic for Applications – c:\Program Files\Common Files\Microsoft Shared\VBA\vba332.dll
Microsoft Access 8.0 Object Library – c:\Program Files\office97\Office\MSACC8.OLB
OLE Automation – c:\WinNT\System32\STDOLE2.TLB
Microsoft DAO 2.5/3.51 Compatibility Library – c:\Program Files\Common Files\Microsoft Shared\DAO\DAO2535.TLB
Microsoft ActiveX Data Objects 2.1 Library – c:\Program Files\Common Files\System\ADO\msado21.tlb
Microsoft Calendar Control 8.0 – C:\WinNT\System32\MSCAL.OCX
Snapshot Viewer Control – c:\PROGRA~1\COMMON~\System\SNAPVIEW.OCX
EDIT: I did not use any kind of packaging program. Just copied my files (Split Db) to their computer.
Last edited: