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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting a Value in a Database

Status
Not open for further replies.

andy570

Technical User
Jan 5, 2004
40
US
I was wondering if there is a way to do the following:

I have a table in MS Access called Reporting and another table named Admin. The ID field in Reporting is related to ID in Admin. In the Admin table I have 2 fields ID and Comments. I have a default comment basically stating that "we will help you as soon as possible."

When the user views his report I would like that message to display. However, nothing is displayed when I query the Admin table and Comments. I know this is because nothing has been entered in the field even though a report has been entered.

My question is this: is there a way to enter the ID into the admin table when the info is entered into the reporting table so the message will be created?

Thank you.
 
You will need to run an additional INSERT query for the admin table. Just make sure that the value of the ID is the same for both queries.

<cfquery ...>
INSERT INTO tblReporting
(ID)
VALUES
(#varID#)
</cfquery>

<cfquery ...>
INSERT INTO tblAdmin
(ID,COMMENTS)
VALUES
(#varID#,'#varComments#')
</cfquery>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top