SOS! How to add new record to many to many relationship using a fo

D

Dirk Goldgar

Rich1234 said:
I have done a step by step edit then save then edit then save to locate
exactly which change leads Access to crash upon saving. It happens as soon
as Drivers.DriverID is removed from the subform record source.

Rich1234 said:
Thanks Dirk and Kelly for your posts.
Just to confirm, I am looking for a way to see if a driver already exists as
being assigned to another vehicle, so that the user will not input the same
driver twice but instead just select the driver and the driver then will be
assigned to multiple vehicles (and will populate the driver info fields in
the sibform for this particular vehicle.)

I have tried Dirk's idea of removing Drivers.DriverID. Here are the results

Yes it does solve this problem in the short term.. but I now cannot save the
form or database without the whole of Access crashing! Unbelievable. This
has never happened consistently before and has just crashed the last 4 times
I have tried this. Some of the VB is missing when I reopen- I have not
checked everything, but the command buttons on the main form have lost all
their VB and now do nothing! when I re-open Access so I have to go back to
the backup version I saved at lunchtime - fortunate I made a backup. (I am
resisting the very strong urge to say harsh words about Microsoft!)

The combo is in the header section of the subform. I am a bit confused as
to why it does work anyway because in design view, the combo says for its
recordsource VehiclesDrivers.DriverID, "Error- No such field in the field
list." And there isn't! Yet the recordsource query for the subform includes
the VehiclesDrivers.DriverID field! Despite this, in form view it is
working! Am I missing something here, or is this very strange indeed?

Here's the recordsource for the subform:

SELECT VehiclesDrivers.VRM, VehiclesDrivers.DriverID, Drivers.Surname,
Drivers.[First Names], Drivers.DOB, Drivers.Sex,
fncDriverWarnings(VehiclesDrivers.DriverID) AS Warnings FROM Drivers INNER
JOIN VehiclesDrivers ON Drivers.DriverID=VehiclesDrivers.DriverID;

Anyway, it works short term (until I need to save, when Access crashes,
negating any benefit and creating more work.) Drivers.DriverID was in the
record source for the subform because I had been using Drivers.DriverID on an
"edit driver profile" button on each record, to open the corresponding record
in a "Drivers" form where users can edit warnings for the driver. As
Drivers.DriverID had been removed from the recordsource, I have instead been
using VehiclesDrivers.DriverID to find the correct driver, which works.

Has anyone else experienced anything similar???? Does this all stem from
the peculiar issue in the relationships window, where Vehicles is still not
showing as being in a relationship with VehiclesDrivers, even after I create
the relationship, close the window and say yes to saving the changes in the
rel. window? I still haven't got to the bottom of this issue which worries
me, Microsoft!

just for the record, the "Add Driver" button sets
Me.AllowAdditions=true then opens a new record using the standard code.. and
it works fine. All of it does til I save!

Please please help if you can! I have spent all afternoon on this.

Something is very wrong. I suspect that your database may be corrupted.
First check, though, that you don't have the Name AutoCorrect option turned
on. That can cause weird problems when Access gets confused about what the
true names of objects are.

Then try a Compact & Repair, close the database, open it, and Compact &
Repair again. If that doesn't work, you may want to try importing all
objects into a new, blank database, after making sure that Name AutoCorrect
is turned off in that database, too.
 
G

Guest

Thanks Dirk
Finally this problem is solved! wow
The problem was that Name Auto Correct was turned on.
At some point I have changed table or field or query names and this had
thrown Access.

After 22 posts, this is Rich, signing off on this one. The green tick by
your post is very well earned Dirk!
the pain is over.....

Rich
"over and out"


Dirk Goldgar said:
Rich1234 said:
I have done a step by step edit then save then edit then save to locate
exactly which change leads Access to crash upon saving. It happens as soon
as Drivers.DriverID is removed from the subform record source.

Rich1234 said:
Thanks Dirk and Kelly for your posts.
Just to confirm, I am looking for a way to see if a driver already exists as
being assigned to another vehicle, so that the user will not input the same
driver twice but instead just select the driver and the driver then will be
assigned to multiple vehicles (and will populate the driver info fields in
the sibform for this particular vehicle.)

I have tried Dirk's idea of removing Drivers.DriverID. Here are the results

Yes it does solve this problem in the short term.. but I now cannot save the
form or database without the whole of Access crashing! Unbelievable. This
has never happened consistently before and has just crashed the last 4 times
I have tried this. Some of the VB is missing when I reopen- I have not
checked everything, but the command buttons on the main form have lost all
their VB and now do nothing! when I re-open Access so I have to go back to
the backup version I saved at lunchtime - fortunate I made a backup. (I am
resisting the very strong urge to say harsh words about Microsoft!)

The combo is in the header section of the subform. I am a bit confused as
to why it does work anyway because in design view, the combo says for its
recordsource VehiclesDrivers.DriverID, "Error- No such field in the field
list." And there isn't! Yet the recordsource query for the subform includes
the VehiclesDrivers.DriverID field! Despite this, in form view it is
working! Am I missing something here, or is this very strange indeed?

Here's the recordsource for the subform:

SELECT VehiclesDrivers.VRM, VehiclesDrivers.DriverID, Drivers.Surname,
Drivers.[First Names], Drivers.DOB, Drivers.Sex,
fncDriverWarnings(VehiclesDrivers.DriverID) AS Warnings FROM Drivers INNER
JOIN VehiclesDrivers ON Drivers.DriverID=VehiclesDrivers.DriverID;

Anyway, it works short term (until I need to save, when Access crashes,
negating any benefit and creating more work.) Drivers.DriverID was in the
record source for the subform because I had been using Drivers.DriverID on an
"edit driver profile" button on each record, to open the corresponding record
in a "Drivers" form where users can edit warnings for the driver. As
Drivers.DriverID had been removed from the recordsource, I have instead been
using VehiclesDrivers.DriverID to find the correct driver, which works.

Has anyone else experienced anything similar???? Does this all stem from
the peculiar issue in the relationships window, where Vehicles is still not
showing as being in a relationship with VehiclesDrivers, even after I create
the relationship, close the window and say yes to saving the changes in the
rel. window? I still haven't got to the bottom of this issue which worries
me, Microsoft!

just for the record, the "Add Driver" button sets
Me.AllowAdditions=true then opens a new record using the standard code.. and
it works fine. All of it does til I save!

Please please help if you can! I have spent all afternoon on this.

Something is very wrong. I suspect that your database may be corrupted.
First check, though, that you don't have the Name AutoCorrect option turned
on. That can cause weird problems when Access gets confused about what the
true names of objects are.

Then try a Compact & Repair, close the database, open it, and Compact &
Repair again. If that doesn't work, you may want to try importing all
objects into a new, blank database, after making sure that Name AutoCorrect
is turned off in that database, too.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup, not by e-mail)
 
A

Amy Blankenship

Yaaay! I had been following this whole saga, but ran out of helpful advice.

-Amy

Rich1234 said:
Thanks Dirk
Finally this problem is solved! wow
The problem was that Name Auto Correct was turned on.
At some point I have changed table or field or query names and this had
thrown Access.

After 22 posts, this is Rich, signing off on this one. The green tick by
your post is very well earned Dirk!
the pain is over.....

Rich
"over and out"


Dirk Goldgar said:
Rich1234 said:
I have done a step by step edit then save then edit then save to locate
exactly which change leads Access to crash upon saving. It happens as soon
as Drivers.DriverID is removed from the subform record source.

:

Thanks Dirk and Kelly for your posts.
Just to confirm, I am looking for a way to see if a driver already exists as
being assigned to another vehicle, so that the user will not input
the same
driver twice but instead just select the driver and the driver then
will be
assigned to multiple vehicles (and will populate the driver info
fields in
the sibform for this particular vehicle.)

I have tried Dirk's idea of removing Drivers.DriverID. Here are the results

Yes it does solve this problem in the short term.. but I now cannot
save the
form or database without the whole of Access crashing! Unbelievable. This
has never happened consistently before and has just crashed the last
4 times
I have tried this. Some of the VB is missing when I reopen- I have
not
checked everything, but the command buttons on the main form have
lost all
their VB and now do nothing! when I re-open Access so I have to go
back to
the backup version I saved at lunchtime - fortunate I made a backup.
(I am
resisting the very strong urge to say harsh words about Microsoft!)

The combo is in the header section of the subform. I am a bit
confused as
to why it does work anyway because in design view, the combo says for its
recordsource VehiclesDrivers.DriverID, "Error- No such field in the field
list." And there isn't! Yet the recordsource query for the subform includes
the VehiclesDrivers.DriverID field! Despite this, in form view it
is
working! Am I missing something here, or is this very strange
indeed?

Here's the recordsource for the subform:

SELECT VehiclesDrivers.VRM, VehiclesDrivers.DriverID,
Drivers.Surname,
Drivers.[First Names], Drivers.DOB, Drivers.Sex,
fncDriverWarnings(VehiclesDrivers.DriverID) AS Warnings FROM Drivers INNER
JOIN VehiclesDrivers ON Drivers.DriverID=VehiclesDrivers.DriverID;

Anyway, it works short term (until I need to save, when Access
crashes,
negating any benefit and creating more work.) Drivers.DriverID was
in the
record source for the subform because I had been using
Drivers.DriverID on an
"edit driver profile" button on each record, to open the
corresponding record
in a "Drivers" form where users can edit warnings for the driver. As
Drivers.DriverID had been removed from the recordsource, I have
instead been
using VehiclesDrivers.DriverID to find the correct driver, which
works.

Has anyone else experienced anything similar???? Does this all stem from
the peculiar issue in the relationships window, where Vehicles is
still not
showing as being in a relationship with VehiclesDrivers, even after I create
the relationship, close the window and say yes to saving the changes
in the
rel. window? I still haven't got to the bottom of this issue which worries
me, Microsoft!

just for the record, the "Add Driver" button sets
Me.AllowAdditions=true then opens a new record using the standard
code.. and
it works fine. All of it does til I save!

Please please help if you can! I have spent all afternoon on this.

Something is very wrong. I suspect that your database may be corrupted.
First check, though, that you don't have the Name AutoCorrect option
turned
on. That can cause weird problems when Access gets confused about what
the
true names of objects are.

Then try a Compact & Repair, close the database, open it, and Compact &
Repair again. If that doesn't work, you may want to try importing all
objects into a new, blank database, after making sure that Name
AutoCorrect
is turned off in that database, too.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup, not by e-mail)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top