Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New Records are not updatable

Status
Not open for further replies.

ProAdjuster

Technical User
Aug 31, 2007
12
0
0
I am working in access with an SQL database. I recently did a batch import of all my excel records. Before that, I had no records in the database.

I have a form for creating new records, and another for editing records. I can edit any record already in the database, but when I add records, I cannot update them. Why would this happen?
 
To clarify, you're using an Access front-end with connects to SQL backend?

What is the code behind your data entry form? (specifically the connection and command objects)

~Melagan
______
"It's never too late to become what you might have been.
 
You are correct. I am using Access for the front end and sql for the back end.

The problem is occurring in tables as well as forms or queries. When I open the table, I cannot update the records I created since the initial import. I can update the records that were initially imported.
 
Is there a primary key on the SQL Server table? Does Access recognize the pk?

Is there a yes/no field without a default set?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Access does recognize the PK

There are yes/no fields, but I have no way to set the defaults. I am currently working with my IT guy towards resolving this issue.

Thanks:)
 
You can create a pseudo primary key on the Access side with a data definition query. This would require knowledge of which field or fields actually identify the unique value.

IMHO yes/no fields are not a good idea. You can generally have greater success and functionality with an integer field.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
I suggest that you add a TimeStamp field in your SQL table or that you disallow Null value for the Yes/No field(s).

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
This issue was resolved. We set the default yes/no value to "1" and now I have no more issues.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top