Access 2003 file in Access 2007: Simple form control

C

crimsonisland

First off, let me state that I did not design the databse or any of the
forms. We have an Access 2003 (A03) file that has a form.

This form's record source is set to a query (SELECT dbo_PAGE.*,
dbo_DEPT.DEPT_NAME FROM dbo_PAGE INNER JOIN dbo_DEPT ON dbo_PAGE.DEPT_ID =
dbo_DEPT.DEPT_ID;). There is a combo box (DEPT_ID) and a text box
(DEPT_NAME).

The combo box's row source is a query (SELECT dbo_DEPT.DEPT_ID,
dbo_DEPT.DEPT_NAME FROM dbo_DEPT ORDER BY dbo_DEPT.DEPT_ID;) that pulls the
DEPT_ID and DEPT_NAME from a static table. The control source for the combo
is the DEPT_ID.

The text box's control source is set to DEPT_NAME and there are no events
associated with any of the controls on the form.

In A03, when the combo's value was changed, the text box updated
automatically. In Access 2007 (A07), when the form is initially displayed,
there is not a problem. However, when the combo's value is changed, the text
box does not update. I am unable to enter text into the box, and when going
to the next record, I get the following error:

"The Microsoft Access database engine cannot find a record in the table
'dbo_DEPT' with key matching field(s) 'DEPT_ID'"

I know I could probably write a small code snippet that will handle this,
but I am trying to find out why this does not work now.

Thank you.
 
G

GBA

I have found that 07 is more picky/insistent on having key fields included
in queries. And that sort of seems like the error message you are getting.
Check the queries that are the record source and the source for the combo
boxes and be sure the field that is the key field of all tables involved are
also included in the query...

Also one time - in a conversion to 07 - I could not get a form to work right
which was sourced on a table; I resourced it on a query that included all
fields from the table and then it worked....never figured that one out....

hope this helps
 

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