By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,290 Members | 1,594 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,290 IT Pros & Developers. It's quick & easy.

Form problem

P: n/a
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.
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Put this in the Click event of the button:

Forms!Inspection!SiteNumber = Me.SiteNumber

Me.SiteNumber is the name of the text control on the Site form. If you
named it txtSiteNumber as you should have, then change to Me.txtSiteNumber.
Good luck,
Pavel

James wrote:

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.

Nov 12 '05 #2

P: n/a
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.

Nov 12 '05 #3

P: n/a
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.

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.