Results 1 to 10 of 10
  1. #1
    IamKJVonly is offline Advanced Beginner
    Windows 10 Access 2010 32bit
    Join Date
    Aug 2018
    Posts
    40

    How do you move the data in one textbox to another textbox in a different form?

    Sorry but my access for dummies is no help. what I have is a tabular form that has three fields and I want to put the data in one of these fields into a text field to replace the data in another form's textbox.

    This more of a learning experience for future projects.


    Thanks for any help you cane give me.
    Dave

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    use the full path:
    forms!myForm2!txtbox = forms!myForm1!txtbox

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,820
    That's one way. Have to figure out what event to put code into.

    Another is to put expression in textbox and no event code needed but value will not save to field.

    Another approach for passing data is with OpenArgs.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    IamKJVonly is offline Advanced Beginner
    Windows 10 Access 2010 32bit
    Join Date
    Aug 2018
    Posts
    40
    Thanks for the help but I just can't seem to handle the expressions or code. I guess the expression you can't teach an old dog new tricks is true in my case. I've been at it for over 3 weeks and haven't made any progress in this area. It's time I moved on.
    Dave

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,820
    Both forms must be open for the expression to work. If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    keiath is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    162
    There is a very Simple way to do this, open the form 1 you wish the details from another form 2 to display, Delete the fields you wish to populate, click Add Existing Fields, then 'Show all tables' Click the Table the for the field you wish to display and drag that field to the form, it will then ask you to set the relationship from one to the other. (the field that binds the two tables.

    For example I have a form called Tenants Details and another Form called Property Details. In the Tenants Details I have a field called 'Property Renting' on the Property Details I want that to show who is the current renter.

    So the relationship is PropertyName=PropertyRented

    Save

    The information from form 2 is now showing in Form 1 - However please beware this only 'displays' the information on the form, but does not save that into the second forms table. This is very useful if all you wont it for is information, there may well be a way to save into the table but that I have not worked out and I don't actually need it

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,820
    Tested technique suggested by keiath. Was not prompted to set relationship. However, relationship was established. What this actually accomplished was to modify the form RecordSource to include the second table.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    keiath is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    162
    Quote Originally Posted by June7 View Post
    Tested technique suggested by keiath. Was not prompted to set relationship. However, relationship was established. What this actually accomplished was to modify the form RecordSource to include the second table.

    Hi June,

    Yes its a simple way to display information from one form to another but only if its for information purposes only - Sometimes you want a piece of information on one form that is in another purely for that purpose, but this method clearly wouldn't work if you then wanted to say do a query on one table as it wouldn't be there as a recorded record, it would be interesting however if using this method if there was away to record that to the table, but I am sure there are simpler ways to do that.

    Keith

  9. #9
    IamKJVonly is offline Advanced Beginner
    Windows 10 Access 2010 32bit
    Join Date
    Aug 2018
    Posts
    40
    Thanks to everyone especially ranman256 for your input. I finally figured it out. The code that worked for me is:

    Forms![frm_F_AddEditBookRecord]![F_Location] = Me.F_Location

    I'm just sorry it took so long. Thanks for putting up with me.
    Dave

  10. #10
    Super Mario is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Aug 2018
    Posts
    12
    Another way is to create a Module, and in it declare a public variable (i.e., Public myVariable AS String or whatever data type you will have in the Text Box); then in Form 1 create an Event (After Update) on the Control (Text Box) such that the value in the Text Box is assigned to the Public Variable myVariable. Then create an Event on Form 2 such that, when the form opens, the value of myVariable is assigned to the Text box in Form 2.

    Text Box 1 value --> myVariable --> Text Box 2 value

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Move Textbox In Access From
    By Eranka in forum Access
    Replies: 2
    Last Post: 06-25-2018, 05:28 PM
  2. Replies: 5
    Last Post: 02-04-2017, 07:34 AM
  3. Replies: 2
    Last Post: 12-22-2015, 09:09 PM
  4. Replies: 5
    Last Post: 04-30-2015, 01:50 AM
  5. Replies: 8
    Last Post: 04-12-2013, 08:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums