Create an update form using 2 data sources.

M

misterted

I am trying to develop a form that displays the customer name from another
table. I do not want to update the customer name, just show it on the form.
When I make a select query, I cannot update anything on the form. How can I
make it work? Can I use 2 data sources to populate the fields of the form and
have 1 data source updateable?
 
J

John W. Vinson

I am trying to develop a form that displays the customer name from another
table. I do not want to update the customer name, just show it on the form.
When I make a select query, I cannot update anything on the form. How can I
make it work? Can I use 2 data sources to populate the fields of the form and
have 1 data source updateable?

The most common way to do this would be to have a Combo Box on the form, using
a query on the second table as the combo's Row Source. The combo would
(ordinarily) be bound to a customerID field in your form's recordsource; it
might have a rowsource query like

SELECT CustomerID, [LastName] & ", " & [FirstName] AS CustomerName ORDER BY
LastName, FirstName;

to display the full name in alphabetical order. You'ld use the combo's
ColumnWidths property to set the width of the ID to 0 and display the name.
 
M

misterted

That is the way I handled the creation screen but not that the record exists,
i am trying to create an update screen. The table is already populated with
a record, I am working on showing the record data, which I need to allow
updates on, along with the connection to the customer name, (which is in
another table). How can I make this happen?
--
Thank so much


John W. Vinson said:
I am trying to develop a form that displays the customer name from another
table. I do not want to update the customer name, just show it on the form.
When I make a select query, I cannot update anything on the form. How can I
make it work? Can I use 2 data sources to populate the fields of the form and
have 1 data source updateable?

The most common way to do this would be to have a Combo Box on the form, using
a query on the second table as the combo's Row Source. The combo would
(ordinarily) be bound to a customerID field in your form's recordsource; it
might have a rowsource query like

SELECT CustomerID, [LastName] & ", " & [FirstName] AS CustomerName ORDER BY
LastName, FirstName;

to display the full name in alphabetical order. You'ld use the combo's
ColumnWidths property to set the width of the ID to 0 and display the name.
 
J

John W. Vinson

That is the way I handled the creation screen but not that the record exists,
i am trying to create an update screen. The table is already populated with
a record, I am working on showing the record data, which I need to allow
updates on, along with the connection to the customer name, (which is in
another table). How can I make this happen?

Which table are you trying to update? The customer table, this form's table,
or both?

My suggestion will allow you to display and select an existing customer using
the combo box, and will (if done correctly) let you update this form's table.
You will need to use the "Not In List" event of the combo if you want to be
able to add a new customer name to the customers table while stil being able
to edit the main form.
 
M

misterted

I am trying to update a table that already contains the customer account#. So
I have a table with data in it and the connection to the other table (which
stores the customer name and priority code) So I guess somehow I need to
link the stored customer account# in the record that I want to update other
fields on, to the table that contains the customer name. Would this be a
combo box with some kind of a select statement? How do you tell it to look
at the acct# that is related to the open record on the form?
 

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

Similar Threads


Top