Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

inserting data into relational database using forms

inserting data into relational database using forms

inserting data into relational database using forms

I have a relational database. I want to add data using a form and for inserting the primary key with which it is related i have to retract the key and it is by select query.... i am not able to do that using visual basic for access.
What do you suggest me here.....
Is there any query with which i can add data directly in a single query?
Thanks in advance....

RE: inserting data into relational database using forms

Hi nani,

This was a little vague, if you have a query as a record source based on the table you can add records to it in just the same way that you add records to a table, its no different!

For a form (main from) simply include the key field in the query source.

there is nothing stopping you adding the key using VB or VBA, excipt if its an auto number type.

if the query is for a subform then you must include the linking key field in the subform's data source query, but you do not have to display it on the form (infact i don't recomend that you do display it)

in this case for a multi field key in a subform access will automatically add the parents key to the subform's multi field key, you will have to ensure that the "common" or link field is included in the subforms query and that this is the link between the main and subform though, normally is by default.

perhapes you could expand on this problem.


Robert Dwyer

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close