Data from Sub Form onto Main Form

G

Guest

I am quite new to Access, know what I need to do, quite happy to try but have
got stuck.
I have a sub form that details any work passed to a contractor and whether
it is completed or not. On my main form I have a completion date. I want to
test if there is any work outstanding with contractors before a completion
date is allowed.
I have written a query that gives me the number of outstanding contractor
jobs and tried to link that into my form but with no luck.
My main form is based on a query and I have tried to re-write the query to
include the number of contractor jobs, whilst this shows the correct number I
am then unable to update any of the data on the main form, once I remove the
link all is ok.
Any help would be appreciated.
Thanks in anticiptation.
 
C

Carl Rapson

jfaz said:
I am quite new to Access, know what I need to do, quite happy to try but
have
got stuck.
I have a sub form that details any work passed to a contractor and whether
it is completed or not. On my main form I have a completion date. I want
to
test if there is any work outstanding with contractors before a completion
date is allowed.
I have written a query that gives me the number of outstanding contractor
jobs and tried to link that into my form but with no luck.
My main form is based on a query and I have tried to re-write the query to
include the number of contractor jobs, whilst this shows the correct
number I
am then unable to update any of the data on the main form, once I remove
the
link all is ok.
Any help would be appreciated.
Thanks in anticiptation.

In the BeforeUpdate event of the completion date control on the main form,
you could check the table where the outstanding contractor jobs are stored
and see if any are uncompleted. If so, abort the update. No need to tie this
into the main form's Record Source.

Carl Rapson
 

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