Passing a value from one form to another form

G

Guest

I have a detail form that has a buton to open a new form. How can I pass the value of a control in that form from tbl-Software to the new form using tbl-CheckOut?

Description:
I have a software database [tbl-Software] that is related to [tbl-CheckOut] using SoftwareID as the primary key and related field. How can I be in the frm-SoftwareMediaLibrary and with a button on that form that opens frm-CheckOut and assign SoftwareID to the new form?
 
G

Guest

Ronnie,

If you want to have the value default for any new records created, on the SoftwareID field on your form CheckOut put
=Forms![frmSoftwareMediaLibarary].[SoftwareID]
You can use the expression builder to create your syntax.

Otherwise, if you want to give the value of the original field to another field on an action event you can put
Me.SoftwareID = Forms![frmSoftwareMediaLibarary].[SoftwareID]

Hope this helps.
 
G

Guest

If you do not want the buttons to show until the fields are populated then on the On Open event of the form you need to have
me.SignOut.visible = False
me.PrintMe.Visible = False

then on the after update of the second field you could put
me.SignOut.visible = True
Me.PrintMe.Visible = True

If you want to test that there are values in both fields before showing the buttons let me know, this is just a quick way to get to that point.



Ronnie said:
Jackie, Thanks so much... I knew it had to be simple but I just could not find the proper syntax. Is it equally easy to hide a button on the newly opened form until 2 field are pupulated?
The fields in question are:
Purpose
ExpRetDate

The buttons are:
SignOut
PrintMe

Thanks in advance.
Ronnie



--
Sincere Thanks Ahead of Time


Ronnie said:
I have a detail form that has a buton to open a new form. How can I pass the value of a control in that form from tbl-Software to the new form using tbl-CheckOut?

Description:
I have a software database [tbl-Software] that is related to [tbl-CheckOut] using SoftwareID as the primary key and related field. How can I be in the frm-SoftwareMediaLibrary and with a button on that form that opens frm-CheckOut and assign SoftwareID to the new form?
 
L

Lynn Trapp

Put the following code in the OnCurrent event of your form:

Me.SignOut.Visible = Not IsNull(Me.AppropriateFieldName)
Me.PrintMe.Visible = Not IsNull(Me.AppropriateFieldName)

Then put the following code in the AfterUpdate event of the field that you
want to base this all on.

Me.SignOut.Visible = True
Me.PrintMe.Visible = True

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


Ronnie said:
Jackie, If you have the time to show me how to keep those 2 buttons from
showing or being enabled that would be great! If not when you have the time
I would really appreciate it very much.
could not find the proper syntax. Is it equally easy to hide a button on
the newly opened form until 2 field are pupulated?pass the value of a control in that form from tbl-Software to the new form
using tbl-CheckOut?
Description:
I have a software database [tbl-Software] that is related to
[tbl-CheckOut] using SoftwareID as the primary key and related field. How
can I be in the frm-SoftwareMediaLibrary and with a button on that form that
opens frm-CheckOut and assign SoftwareID to the new form?
 
G

Guest

I am having a similar issue to Ronnie. I have a value (uniqID) in one form
that I want to pass through to a subform. I can get it to go through using
'=Forms![frmFieldForm]'.[uniqID] I would like to assign that value to a
field that gets populated by the subform. I have tried "uniqID =
Forms![frmFieldForm].[uniqID]" but get an 'invalid control source' response.
Could this be b/c both fields are named the same in either table? Any help
woiuld be appreciated.

Thanks.

Rodney

Jackie L said:
Ronnie,

If you want to have the value default for any new records created, on the SoftwareID field on your form CheckOut put
=Forms![frmSoftwareMediaLibarary].[SoftwareID]
You can use the expression builder to create your syntax.

Otherwise, if you want to give the value of the original field to another field on an action event you can put
Me.SoftwareID = Forms![frmSoftwareMediaLibarary].[SoftwareID]

Hope this helps.

Ronnie said:
I have a detail form that has a buton to open a new form. How can I pass the value of a control in that form from tbl-Software to the new form using tbl-CheckOut?

Description:
I have a software database [tbl-Software] that is related to [tbl-CheckOut] using SoftwareID as the primary key and related field. How can I be in the frm-SoftwareMediaLibrary and with a button on that form that opens frm-CheckOut and assign SoftwareID to the new form?
 

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