Wrong data is presented after query

B

Brian Fielding

The data base consists of 2 key reference tables Scanner Models and Scanner
Parts. As this is a many-to-many relationaship and there is a linking table
ModelPart. A third reference table holds Scanner Makes which has a
many-to-one relationship with the Scanner Models tables.

When work is carried out on customers Scanner a Service Report is input.
The Service Report consists of a main form (recording dates, work done etc)
and a subform (to enter details of parts used). The JobNo (Service Report
number) is the Master Link Field and Child Link Field

On entereing a service report the Scanner Make is selected from a combo box.
The After Update event populates the Scanner Model field. On entering the
subform is given a list of parts based on the scanner type (created using a
complex query on the Row Source) and he selects the parts used and adds
quantities.

Now problem is: if you select a list of Service Reports (say a range of Job
Numbers) and you walk through the service forms the service parts are
displayed correctly but if you enter a subform to (say) add a part, the
parts shown are those of the first scanner type of the selected reports and
not for the scanner type held on the (current) main form.

I'm missing something obvious - on entering the subform the scanner type
needs to be updated (from the main form) before showing the list of scanner
parts.

How is this done ?
 
P

Paul Shapiro

Brian Fielding said:
The data base consists of 2 key reference tables Scanner Models and
Scanner Parts. As this is a many-to-many relationaship and there is a
linking table ModelPart. A third reference table holds Scanner Makes
which has a many-to-one relationship with the Scanner Models tables.

When work is carried out on customers Scanner a Service Report is input.
The Service Report consists of a main form (recording dates, work done
etc) and a subform (to enter details of parts used). The JobNo (Service
Report number) is the Master Link Field and Child Link Field

On entereing a service report the Scanner Make is selected from a combo
box. The After Update event populates the Scanner Model field. On
entering the subform is given a list of parts based on the scanner type
(created using a complex query on the Row Source) and he selects the parts
used and adds quantities.

Now problem is: if you select a list of Service Reports (say a range of
Job Numbers) and you walk through the service forms the service parts are
displayed correctly but if you enter a subform to (say) add a part, the
parts shown are those of the first scanner type of the selected reports
and not for the scanner type held on the (current) main form.

I'm missing something obvious - on entering the subform the scanner type
needs to be updated (from the main form) before showing the list of
scanner parts.

Not sure I understand correctly, but if you're saying that a combo box on
the subform should be showing the parts related to the current scanner type
on the main form, you probably need to requery the combo box rowsource in
the main form's OnCurrent event handler. That assumes the subform's combo
box row source query is using the scanner type value. If you're building the
combo box row source in code, you need to rebuild it in the main form's
OnCurrent event.
 

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