Adding new record to query

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
 
M

Michel Walsh

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
 

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