Linking Forms?

  • Thread starter Thread starter Philip Martin
  • Start date Start date
P

Philip Martin

At the moment I'm building a data base to handle the recording of my
maintenance works. One area that I'm stuck on at the moment is the cross
linking of a form. To explain:

A piece of paper comes in, a Maintenance Request. It contains a number of
fields such as date, time, problem etc. The other thing it has is a unique
job number.

So I have created a table to contain all this data but what I want to do now
is to have a button on the Form that will a) open up a work report form (the
easy bit) and copy the job number into a field on this form/table. The other
thing I would like to do is to have the button set a Yes/No field in the
original table to indicate a work report had been generated. This field
would not be visible in the original form but I could then use it to sort
the table at a later date, looking for outstanding work.

I think I have the concept right here, its just the detail of linking the
forms and setting the Yes/No field.

TIA,

Philip Martin.
 
Use a hidden field on the form whose record source is the
field in the table. The default value of this field should
be no when the record is originally created. When you
press the button to bring up the Work Report, set the
value of the field to Yes. I have had less troubble doing
this if I set the value using 0 (for false) and -1 (for
true). Thus your code would look as follows:

me!workrptFlg=-1

When setting a true/false or yes/no field, -1 is always
true or yes and 0 is always false or no.

The other way involves use of querydef or record set type
VBA queries and is much more difficult to implement.

Hope this helps.

KW
 
Back
Top