Access

G

Guest

I have two tables that are joined with a relationship. I would like to use
the information from one table to show up on a form and in an empty box on
the same form enter data that will fill in another table. By doing this I
can read information about a job from the project manager and then prepare a
short synopsis of the information in another table. Question: How do I
create a form that will show data from one table and allow input of data for
updating another table?
 
G

Guest

You could put this code in the After Update Event of the field that has been
edited.

DoCmd.Setwarnings False
DoCmd.RunSQL "UPDATE [OtherTable] SET FieldName = '" & Me.ThisField & "'
WHERE [RelationshipLink] = " & Me.RelationshipLink
DoCmd.SetWarnings True

This assumes your relationshiplink is numeric, if it isn't the last bit
should read
WHERE [RelationshipLink] = '" & Me.RelationshipLink & "'"
 
G

Guest

I'm sure your answer will assist me, but I'm just a beginner and I'm not even
sure where to enter the code that you have written.

Dennis said:
You could put this code in the After Update Event of the field that has been
edited.

DoCmd.Setwarnings False
DoCmd.RunSQL "UPDATE [OtherTable] SET FieldName = '" & Me.ThisField & "'
WHERE [RelationshipLink] = " & Me.RelationshipLink
DoCmd.SetWarnings True

This assumes your relationshiplink is numeric, if it isn't the last bit
should read
WHERE [RelationshipLink] = '" & Me.RelationshipLink & "'"

bmorganh said:
I have two tables that are joined with a relationship. I would like to use
the information from one table to show up on a form and in an empty box on
the same form enter data that will fill in another table. By doing this I
can read information about a job from the project manager and then prepare a
short synopsis of the information in another table. Question: How do I
create a form that will show data from one table and allow input of data for
updating another table?
 
G

Guest

If you right click on the empty box on your form and then select properties,
you can scroll down to the property that reads After Update. Select [Event
Procedure] and then click on the elipses (three dots) to the right of this
property. This will open up the code editor and is where you can insert the
code.

bmorganh said:
I'm sure your answer will assist me, but I'm just a beginner and I'm not even
sure where to enter the code that you have written.

Dennis said:
You could put this code in the After Update Event of the field that has been
edited.

DoCmd.Setwarnings False
DoCmd.RunSQL "UPDATE [OtherTable] SET FieldName = '" & Me.ThisField & "'
WHERE [RelationshipLink] = " & Me.RelationshipLink
DoCmd.SetWarnings True

This assumes your relationshiplink is numeric, if it isn't the last bit
should read
WHERE [RelationshipLink] = '" & Me.RelationshipLink & "'"

bmorganh said:
I have two tables that are joined with a relationship. I would like to use
the information from one table to show up on a form and in an empty box on
the same form enter data that will fill in another table. By doing this I
can read information about a job from the project manager and then prepare a
short synopsis of the information in another table. Question: How do I
create a form that will show data from one table and allow input of data for
updating another table?
 
J

John Vinson

I have two tables that are joined with a relationship. I would like to use
the information from one table to show up on a form and in an empty box on
the same form enter data that will fill in another table. By doing this I
can read information about a job from the project manager and then prepare a
short synopsis of the information in another table. Question: How do I
create a form that will show data from one table and allow input of data for
updating another table?

The simplest way to do this is to use a Subform. Select the magic-wand
icon on the Toolbox, and then select the "Subform" control. Follow the
prompts; it will create a second form embedded in the first one, to do
exactly what you describe.

John W. Vinson[MVP]
 
G

Guest

John,

Thank you very much for the response. This got right to the heart of my
question.
 

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