After converting mdb to mde, code error: See Below

  • Thread starter Gulf Coast Electric
  • Start date
G

Gulf Coast Electric

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.SetWarnings False
If IsNull(DSum("BillAmt", "TTimeBilling", "TimeID = Parent!TimeID")) Then
MsgBox "Enter an amount in the the Percent Column"

Else:
For some reason access does not like this code in the mde, however it works
fine in the mdb ?
It opens a Report is all.
Suggestions???

DoCmd.OpenReport "RTimeBillingSub", acDesign
Reports!RTimeBillingSub.Report.RecordSource = "SELECT
TTimeBilling.BillingID,TTimeBilling.TimeCounter,TTimeBilling.TimeCounterExt,
TTimeBilling.BillDate,TTimeBilling.BillAmt,TTimeBilling.TimeID FROM
TTimeBilling"
DoCmd.Close acReport, "RTimeBillingSub"
DoCmd.OpenReport "InvoiceReport", acPreview, "",
"[TimeID]=[Forms]![TimeCards]![TimeID]"
Reports!InvoiceReport!QuoteInvLabel.Caption = "Invoice"
Reports!InvoiceReport!LaborAndOverhead.Visible = True
Reports!InvoiceReport!RTimeBillingSubA.Visible = True
Reports!InvoiceReport!RTimeBillingSub.Visible = True

End If
DoCmd.SetWarnings True
 
R

Rick Brandt

Gulf Coast Electric said:
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.SetWarnings False
If IsNull(DSum("BillAmt", "TTimeBilling", "TimeID = Parent!TimeID")) Then
MsgBox "Enter an amount in the the Percent Column"

Else:
For some reason access does not like this code in the mde, however it works
fine in the mdb ?
It opens a Report is all.
Suggestions???

Look at the following line. It is attempting to open the Report in Design
mode. You cannot open any code-based objects (forms, report, modules) in
design mode in an MDE. That is one of the major reasons to use an MDE, to
lock the design of such objects.

DoCmd.OpenReport "RTimeBillingSub", acDesign
Reports!RTimeBillingSub.Report.RecordSource = "SELECT
TTimeBilling.BillingID,TTimeBilling.TimeCounter,TTimeBilling.TimeCounterExt
,
TTimeBilling.BillDate,TTimeBilling.BillAmt,TTimeBilling.TimeID FROM
TTimeBilling"
DoCmd.Close acReport, "RTimeBillingSub"
DoCmd.OpenReport "InvoiceReport", acPreview, "",
"[TimeID]=[Forms]![TimeCards]![TimeID]"
Reports!InvoiceReport!QuoteInvLabel.Caption = "Invoice"
Reports!InvoiceReport!LaborAndOverhead.Visible = True
Reports!InvoiceReport!RTimeBillingSubA.Visible = True
Reports!InvoiceReport!RTimeBillingSub.Visible = True

End If
DoCmd.SetWarnings True
 
Top