Thanks for that it worked but there is still one slight problem.
The form, frmInspection, is where the data in SiteNumber on frmSite
and InspectorNumber on frmInspector will be sent. My system is menu
driven. So, if an inspector clicks on 'Inspector Index', frmInspector
will open with fields shown about the inspector. I have a button that
sends the InspectorNumber data to the inspection form, but as I have
opted for a wizard style approach I want this to happen, but at the
same time for the frmInspector to close and the frmSite to open. I
tried this..
Forms!frmInspection!InspectorNumber = Me!InspectorNumber
DoCmd.OpenForm "frmSite"
DoCmd.Close acForm, "frmInspector"
Then when the site user gets to the site form the same process will
happen but SiteNumber data will be sent to the inspection form.
At the moment the whole thing works if all the forms are open and when
you click on the buttons the process should work. However nothing
happens if the forms aren't already open. So something is wrong
regarding the opening and closing of forms.
Hope this makes some sense and some help would be much appreciated.
Thanks,
James
"Mike Storr" <no****@somewhere.con> wrote in message news:<5t*******************@news20.bellglobal.com> ...
If 'Inspection' is a subform...
Me!subformcontrol.Form!SiteNnumber = Me!SiteNumber
If they are two individual forms...
Forms!Inspection!SiteNumber = Me!SiteNumber
Mike Storr
www.veraccess.com
"James" <ja************@hotmail.com> wrote in message
news:7a*************************@posting.google.co m... I am creating a relational database for inspection and re-ordering
purposes. I have a form called 'Site' which contains various fields,
one in particular is called SiteNumber. I would like it so there is a
button next to the SiteNumber field and when it is clicked, the data
in that field is put into the SiteNumber field in the relating form,
'Inspection'.
It is probably quite a simple piece of code to achieve this, however I
need some assistance.
Many Thanks.