Can't Add New Records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've got a table downloaded from a company's MRP system but I need to have a
3 letter code to identify the company which is the first 3 characters from
the company name field. I created a query and used the Left function to
create this. However, when I tried then to create another query based upon
the query to give me the 3 character code, and another query which gives me
comapny deatils, it will not allow me to add any more records, the add new
record button is greyed out.

Any help appreiated.

Thanks
 
Open the query in design view, change the UniqueRecords of the query to Yes.

Or, add to the SQL Distinct

Select Distinct TableNAme.Field1 , TableNAme.Field2 From TableName
=================

If that doesnt work, you might need to change the SQL
Instead of Inner Join try something like

Select * From Table1 Where FieldNAme In (Select Field1 From Table2)
 
Hi Ofer

Thanks for your reply, but changing the properties did not work. Not knowing
SQL, where would I place the SQL Distinct or your other suggestion. If you
haven't already guessed, I'm bit of a novice!

Thanks
 
SQl as follows:

SELECT DISTINCTROW qryDBO1.Code, qryCL.CUSTOMER, qryDBO1.StartDate,
qryDBO1.NeededDate
FROM qryCL INNER JOIN qryDBO1 ON qryCL.ITEM_PREFIX = qryDBO1.Code;
 
Not sure if the last post went, so ...

SELECT DISTINCTROW qryDBO1.Code, qryCL.CUSTOMER, qryDBO1.StartDate,
qryDBO1.NeededDate
FROM qryCL INNER JOIN qryDBO1 ON qryCL.ITEM_PREFIX = qryDBO1.Code;
 
Sorry for the delay,

Try something like

SELECT qryDBO1.*
FROM qryDBO1 Where Code In (Select qryCL.ITEM_PREFIX From qryCL)
 
Thanks Ofer, just what I wanted!

Ofer Cohen said:
Sorry for the delay,

Try something like

SELECT qryDBO1.*
FROM qryDBO1 Where Code In (Select qryCL.ITEM_PREFIX From qryCL)
 
Back
Top