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 Forums!
  • 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?
2

Share

Insert data from subform textbox into parent form textbox?

Insert data from subform textbox into parent form textbox?

(OP)
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

RE: Insert data from subform textbox into parent form textbox?

Try this
Me!Inst_By= Me!Forms![Search_Inventory]!Form![Installed_by]

RE: Insert data from subform textbox into parent form textbox?

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.

RE: Insert data from subform textbox into parent form textbox?

(OP)
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

RE: Insert data from subform textbox into parent form textbox?

(OP)
Actually neither of those work.  Hmm... .says the form name isn't valid

RE: Insert data from subform textbox into parent form textbox?

Me!Forms![Search Inventory].Form!Edit = True

RE: Insert data from subform textbox into parent form textbox?

(OP)
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.

RE: Insert data from subform textbox into parent form textbox?

Sorry,It was wrong
Forms![Search Inventory].Form!Edit = True

RE: Insert data from subform textbox into parent form textbox?

(OP)
nope, that didn't work either.  AGHGHGHG!  Frustrating :)

RE: Insert data from subform textbox into parent form textbox?

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.

RE: Insert data from subform textbox into parent form textbox?

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

RE: Insert data from subform textbox into parent form textbox?

(OP)
Got it!  it was AllowEdits.  DUH :) thanks everyone!!!

RE: Insert data from subform textbox into parent form textbox?

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!

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