Page 1 of 3 123 LastLast
Results 1 to 15 of 36
  1. #1
    danbo is offline Advanced Beginner
    Windows 7 32bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    55

    Subform opens new form that gets its info from the main form. *yuck!*

    I'm sure this question has been asked but I don't know all of the lingo and have been unable to find it for the last week. I'm working on a project that has two tables. "Calls" and "Customers". The Customers form has a subform, "Calls Subform" in it. When you click on the (New) Hyperlink a new form opens, "Call Details". I would like to pull information off of the "Customers" Form and insert it into the newly opened "Call Details" form.

    I have included a picture because I think this would take me more than a 1000 words to explain.

    Problem #1) Home Phone (named "Phone" and Text223 (named "CID"): are both bound controls so I have to do this in an OpenArgs type process. Anyone know how I can do this?



    Further details:

    On "Customers" the following is true:
    "25" is the "ID" for that customer on the "customers" table
    "Home Phone" is the home phone number on the "Customers" table

    On Call Details the following is true:
    Home Phone is Bound to a table "Calls" and needs to pull it's data from Customers Form

    Text223 is CID and bound to the table "Calls" and needs to pull it's data from "Customers" form.

    Phew! I think I explained it the best I can. Any takers?

    Thank you in advance for your help. I am only two weeks old in the Access world and this one seems complicated to me.

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    I don't know that you need OpenArgs, but for multiple values:

    http://www.baldyweb.com/OpenArgs.htm

    I'd simply open the form in data entry mode and push the values over:

    DoCmd.OpenForm...
    Forms!NewFormName.ControlName = Forms!MainFormName.ControlName
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    danbo is offline Advanced Beginner
    Windows 7 32bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    55
    Quote Originally Posted by pbaldy View Post
    I don't know that you need OpenArgs, but for multiple values:

    http://www.baldyweb.com/OpenArgs.htm

    I'd simply open the form in data entry mode and push the values over:

    DoCmd.OpenForm...
    Forms!NewFormName.ControlName = Forms!MainFormName.ControlName
    I've tried that approach but it looks like it's for pulling the information from the same table of information. Like I said, I'm new to this but worked on that websites ideas for two days trying to figure out all of the Me. and Form! and I can't make heads or tails of it. Am I reading it wrong?

  4. #4
    dblife's Avatar
    dblife is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Nov 2011
    Location
    South Shields, UK
    Posts
    104
    from my brief understanding, you wish to pull data from fields in one form and enter them into fields of another form - the same data - duplicate data.
    am i right in thinking, these two forms are based on different tables?
    are you intentionally duplicating data?
    if not, the simplest way, would be to have the new form based on a query so the details are automatically entered from the original table.

  5. #5
    danbo is offline Advanced Beginner
    Windows 7 32bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    55
    Quote Originally Posted by danbo View Post
    I've tried that approach but it looks like it's for pulling the information from the same table of information. Like I said, I'm new to this but worked on that websites ideas for two days trying to figure out all of the Me. and Form! and I can't make heads or tails of it. Am I reading it wrong?
    Ah... I see! Okay, I'll give it a shot. You'll have to forgive me, I thought that was a signature. My eyes are wacked out right now. I'll see if I can make it work. THANKS!

  6. #6
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Quote Originally Posted by danbo View Post
    I've tried that approach but it looks like it's for pulling the information from the same table of information. Like I said, I'm new to this but worked on that websites ideas for two days trying to figure out all of the Me. and Form! and I can't make heads or tails of it. Am I reading it wrong?
    Tables aren't an issue. With either of those methods you should be able to pull the values from the form controls specified in your picture and put them in the new form. The code wouldn't care what tables were behind either form.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    danbo is offline Advanced Beginner
    Windows 7 32bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    55
    Quote Originally Posted by dblife View Post
    from my brief understanding, you wish to pull data from fields in one form and enter them into fields of another form - the same data - duplicate data.
    am i right in thinking, these two forms are based on different tables?
    are you intentionally duplicating data?
    if not, the simplest way, would be to have the new form based on a query so the details are automatically entered from the original table.
    Yes, you are correct. One of the tables is "Calls" this is where a callers trouble ticket information would be kept. The other is "Customers" and provides demographic data and facilities data about the customer. I'm not too good a building queries and not sure what to do with the data once I have built it all. The main thing I need to do is make sure that the customer ID number is what is tracked for record keeping purposes because people can always change their phone numbers ect.

  8. #8
    danbo is offline Advanced Beginner
    Windows 7 32bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    55
    Quote Originally Posted by pbaldy View Post
    Tables aren't an issue. With either of those methods you should be able to pull the values from the form controls specified in your picture and put them in the new form. The code wouldn't care what tables were behind either form.
    Sorry for my ignorant questions here, but where do I put that code that you provided?

  9. #9
    danbo is offline Advanced Beginner
    Windows 7 32bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    55
    Quote Originally Posted by danbo View Post
    Yes, you are correct. One of the tables is "Calls" this is where a callers trouble ticket information would be kept. The other is "Customers" and provides demographic data and facilities data about the customer. I'm not too good a building queries and not sure what to do with the data once I have built it all. The main thing I need to do is make sure that the customer ID number is what is tracked for record keeping purposes because people can always change their phone numbers ect.
    Ah.... I knew there was another reason why that didn't work for me. When I build my query it only shows the few customers who have submitted a trouble ticket because it looks at both tables for the information. that leaves out the rest of the customers so I can't draw their data in to populate the fields.

    Make sense?

  10. #10
    dblife's Avatar
    dblife is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Nov 2011
    Location
    South Shields, UK
    Posts
    104
    yes.
    if you right click the line joining the two tables and select another one of the three options in the 'join properties' box, you should see all the records.

  11. #11
    danbo is offline Advanced Beginner
    Windows 7 32bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    55
    Quote Originally Posted by dblife View Post
    yes.
    if you right click the line joining the two tables and select another one of the three options in the 'join properties' box, you should see all the records.
    Okay, I'll give that a shot too. I'm trying both ideas here so we'll see what winds up working. Thanks again.

  12. #12
    danbo is offline Advanced Beginner
    Windows 7 32bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    55
    Quote Originally Posted by danbo View Post
    Okay, I'll give that a shot too. I'm trying both ideas here so we'll see what winds up working. Thanks again.
    Looks like that may work but I'm getting a type mismatch error I'll have to look into. Thanks man!

  13. #13
    danbo is offline Advanced Beginner
    Windows 7 32bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    55

    Angry

    Quote Originally Posted by danbo View Post
    Looks like that may work but I'm getting a type mismatch error I'll have to look into. Thanks man!
    Well I tried it and it worked some but not enough. I was able to pull the customers phone number up but it wouldn't auto fill in the customers ID even when set to do so. The other problem it gave me was not placing the phone number in the table " calls ". as soon as I chose it as a control source for "Home Phone" in the calls table it stopped allowing me to enter data even though it showed up as a choice.
    Back to the drawing board.

  14. #14
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Quote Originally Posted by danbo View Post
    Sorry for my ignorant questions here, but where do I put that code that you provided?
    Based on your description, the click or double click event of that textbox. VBA code goes here, if you didn't know:

    http://www.baldyweb.com/FirstVBA.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  15. #15
    danbo is offline Advanced Beginner
    Windows 7 32bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    55
    Quote Originally Posted by pbaldy View Post
    Based on your description, the click or double click event of that textbox. VBA code goes here, if you didn't know:

    http://www.baldyweb.com/FirstVBA.htm
    hmm. Okay, but this isn't a "textbox". it's a hyperlink in a subform that opens up a new form. the new form is where I need the information and it needs to come from the main form that is holding the subform.
    Does it matter or should I try to put it on there with the rest of the click commands?
    wanna log in and fix it for me? I'll buy you a beer!

Page 1 of 3 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 12-04-2011, 09:11 PM
  2. Replies: 3
    Last Post: 11-16-2011, 01:56 PM
  3. Replies: 5
    Last Post: 11-11-2011, 11:06 AM
  4. Replies: 6
    Last Post: 11-05-2010, 10:11 AM
  5. copy info in subform as well as main form
    By Coolpapabell in forum Forms
    Replies: 0
    Last Post: 09-30-2009, 10:02 AM

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