Skip to content
Advertisement

Access add new SQL data

I would like to add some Data in my SQL table…

Thats the actual build. – table User (Saves Useraccess data with column UserId, UserForename,UserSurname, Mail) – Formular add new User

My formular has 3 TextFields for UserForename, UserSurname, Mail and a button for adding the details.

By clicking the button the following code should be executed…

The UserID should be filled automatically with the next free ID space (descending numbered)

I am looking for a solution like… 3 hours? 😀

Could somebody help me?

thanks.

Advertisement

Answer

As advised in comments by krish KM, change the UserID to AutoNumber and you won’t have to worry about this field.

Then setup a query that you can pass the import values as parameters.

Query with parameters:

Calling the above query in VBA:

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement