I have a subform that works fine until you import it into a new database
when it crashes if you try to open it in either disign or form view.
The form, "Attendees_Subform" in my application was pattern after the
same form used in the MS template, "Event Management.mdb" application
that is downloaded from the MS Template Gallery on their website.
I narrowed down the problem to the Control Source in the,
"Attendees_Subform using the procedures outlined toward the end of this
posting. However, I do not know how to handle the problem. Below, you
will see the Control source for the two, “Attendees_Subforms”; the field
names used in each form, and the Control Source for each of the
fieldnames used in each database form:
First, here is how the form’s (suspicious) Control Source as written in
the, “Attendees_subform” in MyApplication.mdb application; that crashes
both my application and MS Access2003 as well (SQL View):
SELECT DISTINCTROW Registration.RegistrationID,
Registration.RegistrationFee, Events.EventName, Registration.eventdate,
Registration.SalesTaxRate, [Sum Of Payments Query].[Total Payments],
Registration.AttendeeID, Registration.progname,
Registration.serviceclass, Registration.RegistrationDate
FROM Events INNER JOIN (Registration LEFT JOIN [Sum Of Payments Query]
ON Registration.RegistrationID = [Sum Of Payments Query].RegistrationID)
ON Events.EventID = Registration.EventID
ORDER BY Registration.RegistrationID;
MyApplicationt.mdb Form: Attendees_Subform
Form Fields Here ar the fields used In My Application:
Fieldnames Names and =Control Source
eventtdate same
Serviceclass same
progname same
Eventname same
RegistrationID same
Total Payments same
RegistrationDate same
unbound AttendeeLastName
unbound minit
unbound AttendeeFirstName
unbound Sale Amount
=[RegistrationFee]+CLng((([SalesTaxRate]*[RegistrationFee])*100))/100
unbound Amount Due =[Sale Amount]-nz([Total Payments])
Here is how the form’s Control Source is written in the,
“Attendees_subform” in the Event Management.mdb application; that works
(SQL View):
SELECT DISTINCTROW Registration.RegistrationID,
Registration.RegistrationFee, Events.EventName, Events.StartDate,
Registration.SalesTaxRate, [Sum Of Payments Query].[Total Payments],
Registration.AttendeeID
FROM Events INNER JOIN (Registration LEFT JOIN [Sum Of Payments Query]
ON Registration.RegistrationID = [Sum Of Payments Query].RegistrationID)
ON Events.EventID = Registration.EventID
ORDER BY Registration.RegistrationID;
Event Management.mdb Form: Attendees_Subform
Form Fields These are the fields used:
Fieldnames Names and Control Source =
Startdate same
Eventname same
Total Payments same
unbound Sale Amount
=[RegistrationFee]+CLng((([SalesTaxRate]*[RegistrationFee])*100))/100
unbound Amount Due =[Sale Amount]-nz([Total Payments])
This is the last step using a procedure I used for isolating the
crashing in MyApplication.mdb and MS Access 2003:
1. Created a new (blank) application.mdb
2. Created a tablelink to the backend.
3. Created a blank form and name it, “Attendees_Subform. I Added no
controls to this form.
4. Changed the form to design view, View/Code, and made all the
references under, Tools/References to the follows – “Visual Basic for
Applications”, “Microsoft Access 11.0 Object Library”, “OLE Automation”,
“Microsoft DAO 3.6 Object Library”, “Microsoft ActiveX Data Objects 2.8
Library”, “Microsoft ADO Ext. 2.8 for DDL and Security”
5. I did nothing more than add the following Control Source used in
MyApplication.mdb (it crashes right away):
SELECT DISTINCTROW Registration.RegistrationID,
Registration.RegistrationFee, Events.EventName, Registration.eventdate,
Events.StartDate, Registration.SalesTaxRate, [Sum Of Payments
Query].[Total Payments], Registration.AttendeeID, Registration.progname,
Registration.serviceclass, Registration.RegistrationDate FROM Events
INNER JOIN (Registration LEFT JOIN [Sum Of Payments Query] ON
Registration.RegistrationID = [Sum Of Payments Query].RegistrationID) ON
Events.EventID = Registration.EventID ORDER BY
Registration.RegistrationID;
I can't figure out what's going on.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!