Editing records from two different tables on a single form

K

Kolten

I have a table that holds questionnaire data.
I have another table that holds event data.
Relationship is as follows:

tblQuestionnaire
QuestionnaireID
EventID
Address... etc

tblEvent
EventID
EnteredBy
DateTime
ClientLastName
ClientFirstName

The linking key is obviously EventID.

I have a form that displays all the Questionnaire data from the
Questionnaire table.
I want to place the DateTime from the Event table onto this form.

I cannot seem to figure out how to grab the DateTime record from the Event
table for the particular Questionnaire the user is currently viewing.

The DateTime fields also needs to be editable.

Is there a way to do this without getting into VB code?
Thanks.
 
D

Danny J. Lesandrini

Kolten:

So what you're saying is that you want to have one query that allows
simultaneous updating to both participating tables. Is that correct?

If so, it can't be done.

If all you need to do is to update the DateTime field, then make it
unbound and perform an UPDATE beind the scenes, in the form or
control's AfterUpdate event.

Private Sub Form_AfterUpdate()

sSQL = "UPDATE tblEvent SET DateTime=Now() WHERE EventID=" & Me!EventID
CurrentDb.Execute sSQL

End Sub

If you don't want to update to Today's date, then expose an unbound
editable text box, and use that value.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top