S
Sharon
At first I was using the FormType in a List. I had it working correctly that
when I went into the tblReceipts and chose a ReportType (in the list) it
would automatically open that form so I could input the information into that
particular form. For instance, if I chose "Expense Report" it would open the
frmExpenseReport and I would go on my merry way. Then, I had to think too
hard and realized that I should have used ReportType in a separate table.
So, when I went back and created a tblReportType with a "ReportTypeID" and a
"ReportType" field and created a drop down box in the form with these two
columns (only ReportType is visible), and then tried to run the code I
created to open the forms, etc., it won't work. I have tried various things
such as changing the "Cancel as Integer" and using "dim ReportType as
integer", changing the "Me" to "tblReports.ReportType", changing the "Expense
Report" to the ReportTypeID instead of the ReportType, i.e. "1" instead of
"Expense Report" and I just can't get it to work right. I am tempted to go
back to the way I had it, but I don't think that is the proper way to design
a database? Any help is appreciated as I am now just going in circles and
probably messing other portions of the database up with my random trying of
different things. Thanks.
Private Sub cmbReportType_Exit(Cancel As Integer)
If tblReports.ReportType = "Expense Report" Then
DoCmd.OpenForm "frmExpenseReport", , , , , acNormal
ElseIf Me.ReportType = "Purchase Order Report" Then
DoCmd.OpenForm "frmPurchaseOrder", , , , , acNormal
ElseIf Me.ReportType = "Check Request Report" Then
DoCmd.OpenForm "frmCheckRequest", , , , , acNormal
ElseIf Me.ReportType = "Travel Expense Report" Then
DoCmd.OpenForm "frmTravelExpenseReport", , , , , acNormal
ElseIf Me.ReportType = "Reimbursement Check Report" Then
DoCmd.OpenForm "frmReimbursementCheck", , , , , acNormal
ElseIf Me.ReportType = "Trip Report" Then
DoCmd.OpenForm "frmTripReport", , , , , acNormal
End If
End Sub
when I went into the tblReceipts and chose a ReportType (in the list) it
would automatically open that form so I could input the information into that
particular form. For instance, if I chose "Expense Report" it would open the
frmExpenseReport and I would go on my merry way. Then, I had to think too
hard and realized that I should have used ReportType in a separate table.
So, when I went back and created a tblReportType with a "ReportTypeID" and a
"ReportType" field and created a drop down box in the form with these two
columns (only ReportType is visible), and then tried to run the code I
created to open the forms, etc., it won't work. I have tried various things
such as changing the "Cancel as Integer" and using "dim ReportType as
integer", changing the "Me" to "tblReports.ReportType", changing the "Expense
Report" to the ReportTypeID instead of the ReportType, i.e. "1" instead of
"Expense Report" and I just can't get it to work right. I am tempted to go
back to the way I had it, but I don't think that is the proper way to design
a database? Any help is appreciated as I am now just going in circles and
probably messing other portions of the database up with my random trying of
different things. Thanks.
Private Sub cmbReportType_Exit(Cancel As Integer)
If tblReports.ReportType = "Expense Report" Then
DoCmd.OpenForm "frmExpenseReport", , , , , acNormal
ElseIf Me.ReportType = "Purchase Order Report" Then
DoCmd.OpenForm "frmPurchaseOrder", , , , , acNormal
ElseIf Me.ReportType = "Check Request Report" Then
DoCmd.OpenForm "frmCheckRequest", , , , , acNormal
ElseIf Me.ReportType = "Travel Expense Report" Then
DoCmd.OpenForm "frmTravelExpenseReport", , , , , acNormal
ElseIf Me.ReportType = "Reimbursement Check Report" Then
DoCmd.OpenForm "frmReimbursementCheck", , , , , acNormal
ElseIf Me.ReportType = "Trip Report" Then
DoCmd.OpenForm "frmTripReport", , , , , acNormal
End If
End Sub