Adding new record to query

  • Thread starter Thread starter Roy Goldhammer
  • Start date Start date
R

Roy Goldhammer

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
 
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
 
Back
Top