PDA

View Full Version : Adding new record to query


Roy Goldhammer
May 27th, 2004, 09:07 AM
Hello there

I have table of citys with two fields
CityID autonumber, city text(20)

I've bilt the current query for adding new city:

PARAMETERS prmCity TEXT(20)
INSERT INTO Citys(City)
SELECT prmCity as expr1

But it don't work

It says that i tried to enter NULL to require field
What i need to do to fix it?

any help would be useful

Michel Walsh
May 27th, 2004, 11:33 AM
Hi,


Try


INSERT INTO Citis(city) VALUES( prmCity )



If there is a required field, other than city, that is designed to not
accept NULL, you have to supply it too (or a not null default value).


INSERT INTO Citis(city, otherField) VALUES( prmCity, otherValue)




Hoping it may help,
Vanderghast, Access MVP



"Roy Goldhammer" > wrote in message
...
> Hello there
>
> I have table of citys with two fields
> CityID autonumber, city text(20)
>
> I've bilt the current query for adding new city:
>
> PARAMETERS prmCity TEXT(20)
> INSERT INTO Citys(City)
> SELECT prmCity as expr1
>
> But it don't work
>
> It says that i tried to enter NULL to require field
> What i need to do to fix it?
>
> any help would be useful
>
>

Google