Smart questions
Smart answers
Smart people
Join Tek-Tips Forums
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Insert data from subform textbox into parent form textbox?Helpful Member!(2) 

tylerwork (TechnicalUser) (OP)
7 Nov 02 16:14
I have in a subform a textbox that has info in it.  I have a button that I want to click, and automatically populate a textbox in a text box in the parent form.  Don't ask the reason, it's how the user wants it!  :)

what line of code will work with this?

I have this but it isn't working:

Me!Inst_By.Value = Me!Forms.Search_Inventory.Installed_by.Value
Helpful Member!  essnrv (Programmer)
7 Nov 02 16:23
Try this
Me!Inst_By= Me!Forms![Search_Inventory]!Form![Installed_by]
Helpful Member!  JeremyNYC (Programmer)
7 Nov 02 16:27
Refer to things on subforms like this:
forms!NameOfTheMainForm!NameOfTheControlThatHoldsTheSubform.Form!NameOfControlOnSubformYouWantToReference

"Forms" and "Form" should be in there literally. You have to refer to the name of the control that holds the subform, which may or may not be the same as the name of the subform. I make sure they're always named the same thing, but that's a personal preference thing.

Taking this into account, you'd want to do this:
Me!Inst_By.Value = Me!Search_Inventory.form.Installed_by.Value

Jeremy

PS: Why does the user want this? Really, I'd be interested to hear why. It sounds like you already know it's a weird thing to do, but I'm always curious to learn about users.

=============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995

http://www.AlphaBetCityDataworks.com
Take a look at the Developer's section of the site for some helpful fundamentals.


Remember to reward helpful tips with the stars they deserve.

tylerwork (TechnicalUser) (OP)
7 Nov 02 16:28
Thanks!  and if I want a button in a subform to turn EDITS ON in the parent form, how do I do that?

Me!Forms![Search_Inventory]!Edit = True

that doesn't work
tylerwork (TechnicalUser) (OP)
7 Nov 02 16:32
Actually neither of those work.  Hmm... .says the form name isn't valid
essnrv (Programmer)
7 Nov 02 16:33
Me!Forms![Search Inventory].Form!Edit = True
tylerwork (TechnicalUser) (OP)
7 Nov 02 16:35
With all of these, it keeps telling me that it can't find the FIELD:  "Forms"

Keep in mind that the button I am using is in the Child_Subform, while the location of the actions I want to take is in the Parent_Form.
essnrv (Programmer)
7 Nov 02 16:39
Sorry,It was wrong
Forms![Search Inventory].Form!Edit = True
tylerwork (TechnicalUser) (OP)
7 Nov 02 16:45
nope, that didn't work either.  AGHGHGHG!  Frustrating :)
JeremyNYC (Programmer)
7 Nov 02 16:50
Isn't that "AllowEdits", and not "Edit"?

Jeremy

=============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995

http://www.AlphaBetCityDataworks.com
Take a look at the Developer's section of the site for some helpful fundamentals.


Remember to reward helpful tips with the stars they deserve.

essnrv (Programmer)
7 Nov 02 16:51
What is your control name and type ?

If it is a Check box then

Dim FormName as Form
Set FormName=Forms![Search Inventory].Form
FormName![Edit]=-1 'Checked 0 for Unchecked
tylerwork (TechnicalUser) (OP)
7 Nov 02 16:55
Got it!  it was AllowEdits.  DUH :) thanks everyone!!!
JeremyNYC (Programmer)
7 Nov 02 16:55
Forms![Search Inventory].!AllowEdits = True =============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995

http://www.AlphaBetCityDataworks.com
Take a look at the Developer's section of the site for some helpful fundamentals.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close