[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 276
  • Last Modified:

How to insert data autoincrement field (MS Access)

Hi,
I will need to insert data to a table where the primary key is autoincremented.

Assuming my PK is CT_ID (autonumber)
The symbol (?) corresponds to CT_ID

What would be the syntax for the following insert:

strInsert = "insert into COURSES_TAKEN (?, UST_ID, COURSE_ID, SEMESTER, [YEAR], GRADE) values ( ?, 1111, 'CRSID', 'SPRING', 2005, 'A')"

Let me know ..
Thanks.

_Esam
0
_Esam
Asked:
_Esam
1 Solution
 
sajuksCommented:
ignore the autonumber field
strInsert = "insert into COURSES_TAKEN (UST_ID, COURSE_ID, SEMESTER, [YEAR], GRADE) values ( 1111, 'CRSID', 'SPRING', 2005, 'A')"
0
 
_EsamAuthor Commented:
Indeed, ignored them, and worked ..

Thanks.
_Esam
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now