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!

inserting data into relational database using forms

Status
Not open for further replies.

nani

IS-IT--Management
Jul 2, 2001
8
0
0
PH
Hi
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....
nani
 
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.

HTH
[sig]<p>Robert Dwyer<br><a href=mailto:rdwyer@orion-online.com.au>rdwyer@orion-online.com.au</a><br>[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top