Re: Insert Null problem



First, it would be a good ideal to use aliases in order to make your
statement more readable:

SELECT ES.ExhibitorID, ES.ExhibitorShowID,
E.ExhibitorShortName, E.ExhibitorName, E.Notes, E.ProductDescription,
E.DivisionID, E.ShowCategories, E.NewExhibitor
FROM ExhibitorsShows ES
INNER JOIN Exhibitors E ON ES.ExhibitorID = E.ExhibitorID

SELECT ES.ExhibitorShowID, ES.ExhibitorID, ESB.BoothName
FROM ExhibitorsShows ES
INNER JOIN ExhibitorShowBooths ESB ON ES.ExhibitorShowID =
ESB.ExhibitorShowID

Second, this is probably because you have forgotten to set the UniqueTable
property and Resync command for both the main form and the subform.

Finally, it's totally unclear what is the table that you want to add a
record to in your subform; it is ExhibitorsShows or ExhibitorsShowsBooths?

If it's ExhibitorShowBooths then you must select
ExhibitorShowBooths.ExhibitorShowID and not ExhibitorShows.ExhibitorShowID
in the record source of the subform.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


"ToniS" <ToniS@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:BA0FAC94-71A7-4E5E-8F8C-1DAD1E95FA75@xxxxxxxxxxxxxxxx
I am trying to add a row w/i the subform and get the following error,
"Cannot
insert the value NULL into column 'ExhibitorShowID'table
ExhibitorShowBooths
column does not allow nulls, INSERT fails"

Below is my main form recordsource:

SELECT ExhibitorsShows.ExhibitorID, ExhibitorsShows.ExhibitorShowID,
Exhibitors.ExhibitorShortName, Exhibitors.ExhibitorName,
Exhibitors.Notes, Exhibitors.ProductDescription, Exhibitors.DivisionID,
Exhibitors.ShowCategories, Exhibitors.NewExhibitor
FROM ExhibitorsShows
INNER JOIN Exhibitors ON ExhibitorsShows.ExhibitorID =
Exhibitors.ExhibitorID

My subform recordsource is as follows:
SELECT ExhibitorsShows.ExhibitorShowID, ExhibitorsShows.ExhibitorID,
ExhibitorShowBooths.BoothName
FROM ExhibitorsShows
INNER JOIN
ExhibitorShowBooths ON ExhibitorsShows.ExhibitorShowID =
ExhibitorShowBooths.ExhibitorShowID

I have tried setting the Link child Fields and Link Master Fields to
ExhibitorID and then
tried setting both to ExhibitorShowID

The table Structure for ExhibitorShowsBooths is as follows:

ExhibitorShowBoothID (unique key)
ExhibitorShowID (Foreign key to ExhibitorsShows)
BoothName

I also tried adding a txt and a cmbo box with in the subform that is
invisible that would be used to store
the exhbitorShowID. I was able to set the cmbo box w/ the correct data
but
still
was gettign the above error

Any suggestions would be greatly appreciated
Thanks
TSharp



.



Relevant Pages

  • Re: Insert Null problem
    ... I also changed my subform select to select the ... Should the main form unique table be set to ExhibitorsShows ... INNER JOIN Exhibitors E ON ES.ExhibitorID = E.ExhibitorID ... Sylvain Lafontaine, ing. ...
    (microsoft.public.access.adp.sqlserver)
  • RE: Insert Null problem
    ... confused on the recordsource for the subform... ... ExhibitorsShows has ExhibitorID that is a foreign key to Exhibitors So I am ... I also tried adding a txt and a cmbo box with in the subform that is ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Insert Null problem
    ... ExhibitorID (foriegn key to Exhibitors) ... I also changed my subform select to select the ... Should the main form unique table be set to ExhibitorsShows ... INNER JOIN Exhibitors E ON ES.ExhibitorID = E.ExhibitorID ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Insert Null problem
    ... ExhibitorShowBooths ESB. ... Main form RecordSource is set to: ... If I have the subform set to the above recordSource, ... entry in the tables ExhibitorsShows and ExhibitorShowBooths at the same ...
    (microsoft.public.access.adp.sqlserver)