Record Source Problem

M

Mary Fetsch

In my Access 2000 project, I have a form where the record source is blank in
the form properties. In the Form_Load event, I set the record source equal
to the following SQL statement that joins 2 tables.



Select * from TRIP T

Inner join CROP_YEAR CY

On T.YEAR_CODE = CY.YEAR_CODE

Where ((T.YEAR_CODE LIKE '04-05')

And (T.HAULER_CODE LIKE 'P'))

Order by START_DATE desc, GROVE_CODE, TRIP_CODE



In VB, I'm setting the form's unique table to Trip. I'm not selecting any
data in the Crop Year table - I'm just using its Start Date in the Order By
statement. There will be times when there's no Trip data that matches the
criteria in the record source. When Trip data is found, it will always have
matching data in the Crop Year table.



If there's no Trip data that matches the criteria in the record source, I've
had some problems, so I set the following record source, which won't return
any records:



Select * from TRIP Where 1 = 0



When this is my record source, I can add as many new Trip records as I want,
even though they don't match the record source criteria.



When there's Trip data that matches the criteria in the record source, I
have no problems getting the correct data when I open the form. But when I
add a new record that matches the criteria in the record source, I get the
following message after the Form Before_Update event fires.



"The data was added to the database but the data won't be displayed in the
form because it doesn't satisfy the criteria in the underlying record
source."



The Form After_Update event doesn't fire, and the new record doesn't appear
on the screen. (However, the new record is in the Trip table.) If I then
close and reopen the form, I see the new record on the screen.



I don't know why this is happening. Is it some sort of timing issue? Does
it have anything to do with the fact that this is a project (.adp) rather
than a .mdb? I'll appreciate any help anyone can give me on this.
 

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