S
stockwell43
Hello,
I have a simple database that was created in 2003. I copied it and brought
it home to try it on 2007. I heard, it should still work as the coding is the
same but maybe some of the mechanics in 2007 maybe different. I open the
database and the main menu popped up. When I clicked on the CBO for the
forms, nothing happened. When I clicked on the CBO for the reports, nothing
happened. When I clicked on the exit button, nothing happened. I then opened
the database in design view and clicked on the tables, forms, reports and
queries and they all opened fine. I am guessing it has something to do with
the code behind the main menu. This was from another database so I am not
sure what could be wrong. Here it is:
Option Compare Database
Option Explicit ' All variables must be declared
Private blnShowReport As Boolean
Private Sub Form_Activate()
ClearComboboxes
DoCmd.Restore
End Sub
Private Sub Form_Load()
'Call ReportPermissions
'Call FillComboList(cmbReport)
'Call FillForm(cmbForm)
ClearComboboxes
ShortcutMenuBar = "DBSecurity"
Call basDatabaseSecurity.PreventBypassNewProp
End Sub
Private Sub Form_Current()
ClearComboboxes
End Sub
Private Sub cmdExit_Click()
DoCmd.Quit
End Sub
Private Sub cmbForm_Change()
On Error GoTo eh
Dim FileName As String
FileName = DLookup("[TaskFileName]", "tblFormName", "[TaskFormName] =
cmbForm.Value")
DoCmd.OpenForm FileName, acNormal
'Dim strFormName As String
'strFormName = cmbForm.ItemData(cmbForm.ListIndex)
' Open reports with current filter
'DoCmd.OpenForm strFileName, acNormal
Exit Sub
eh:
If Err.Number <> 2501 Then
MsgBox Err.Number & " " & Err.Description, vbInformation,
"Form-Related Error"
Else
cmbForm = ""
End If
End Sub
Private Sub cmbReport_Change()
On Error GoTo eh
Dim ReportName As String
ReportName = DLookup("[ReportFileName]", "tblReportName",
"[ReportFormName] = cmbReport.Value")
DoCmd.OpenReport ReportName, acViewPreview, , Me.Filter
'strReportName = cmbReport.ItemData(cmbReport.ListIndex)
' Open reports with current filter
'DoCmd.OpenReport strReportName, acViewPreview, , Me.Filter
Exit Sub
eh:
If Err.Number <> 2501 Then
MsgBox Err.Number & " " & Err.Description, vbInformation,
"Report-Related Error"
Else
cmbReport = ""
End If
End Sub
Private Sub ClearComboboxes()
cmbReport = ""
cmbForm = ""
End Sub
Private Sub Command19_Click()
On Error GoTo Err_Command19_Click
Dim oApp As Object
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
Exit_Command19_Click:
Exit Sub
Err_Command19_Click:
MsgBox Err.Description
Resume Exit_Command19_Click
End Sub
Any help would be greatly appreciated as I am in big trouble if I have to
redo all the database if we convert to 2007 which is a good possibility from
what I heard.
Thanks!!!!
I have a simple database that was created in 2003. I copied it and brought
it home to try it on 2007. I heard, it should still work as the coding is the
same but maybe some of the mechanics in 2007 maybe different. I open the
database and the main menu popped up. When I clicked on the CBO for the
forms, nothing happened. When I clicked on the CBO for the reports, nothing
happened. When I clicked on the exit button, nothing happened. I then opened
the database in design view and clicked on the tables, forms, reports and
queries and they all opened fine. I am guessing it has something to do with
the code behind the main menu. This was from another database so I am not
sure what could be wrong. Here it is:
Option Compare Database
Option Explicit ' All variables must be declared
Private blnShowReport As Boolean
Private Sub Form_Activate()
ClearComboboxes
DoCmd.Restore
End Sub
Private Sub Form_Load()
'Call ReportPermissions
'Call FillComboList(cmbReport)
'Call FillForm(cmbForm)
ClearComboboxes
ShortcutMenuBar = "DBSecurity"
Call basDatabaseSecurity.PreventBypassNewProp
End Sub
Private Sub Form_Current()
ClearComboboxes
End Sub
Private Sub cmdExit_Click()
DoCmd.Quit
End Sub
Private Sub cmbForm_Change()
On Error GoTo eh
Dim FileName As String
FileName = DLookup("[TaskFileName]", "tblFormName", "[TaskFormName] =
cmbForm.Value")
DoCmd.OpenForm FileName, acNormal
'Dim strFormName As String
'strFormName = cmbForm.ItemData(cmbForm.ListIndex)
' Open reports with current filter
'DoCmd.OpenForm strFileName, acNormal
Exit Sub
eh:
If Err.Number <> 2501 Then
MsgBox Err.Number & " " & Err.Description, vbInformation,
"Form-Related Error"
Else
cmbForm = ""
End If
End Sub
Private Sub cmbReport_Change()
On Error GoTo eh
Dim ReportName As String
ReportName = DLookup("[ReportFileName]", "tblReportName",
"[ReportFormName] = cmbReport.Value")
DoCmd.OpenReport ReportName, acViewPreview, , Me.Filter
'strReportName = cmbReport.ItemData(cmbReport.ListIndex)
' Open reports with current filter
'DoCmd.OpenReport strReportName, acViewPreview, , Me.Filter
Exit Sub
eh:
If Err.Number <> 2501 Then
MsgBox Err.Number & " " & Err.Description, vbInformation,
"Report-Related Error"
Else
cmbReport = ""
End If
End Sub
Private Sub ClearComboboxes()
cmbReport = ""
cmbForm = ""
End Sub
Private Sub Command19_Click()
On Error GoTo Err_Command19_Click
Dim oApp As Object
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
Exit_Command19_Click:
Exit Sub
Err_Command19_Click:
MsgBox Err.Description
Resume Exit_Command19_Click
End Sub
Any help would be greatly appreciated as I am in big trouble if I have to
redo all the database if we convert to 2007 which is a good possibility from
what I heard.
Thanks!!!!