Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am trying in code to connect a textbox "Choice1" on a form with the textbox "assignment"on a subform "subfrmMake assignment".

    What I want to do is when a person fills in the textbox Choice1 on a form the after update event will make the contents of "assignment" on the subform =.

    Some varation of me.Choice1 = me.subfrmMakeAssignment.assignment but I can't get the last part correct. The last period will not work.


    Any suggestions?

    Thanks.

    Paul

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Your post is confusing. Your description "when a person fills in the textbox Choice1 on a form the after update event will make the contents of "assignment" on the subform =" suggests that you want to update a text box in the subform, but the line "me.Choice1 = me.subfrmMakeAssignment.assignment" would update a text box in the main form. Please try to explain unambiguously what you want to accomplish.

  3. #3
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by HansV View Post
    Your post is confusing. Your description "when a person fills in the textbox Choice1 on a form the after update event will make the contents of "assignment" on the subform =" suggests that you want to update a text box in the subform, but the line "me.Choice1 = me.subfrmMakeAssignment.assignment" would update a text box in the main form. Please try to explain unambiguously what you want to accomplish.

    I want to be able to type something in the form textbox "Choice1" and then what is typed in that box will appear in the subform textbox assignment.

    I guess my code is all wrong.

    Paul

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    But in theory, a subform can contain multiple records. Would you want the text to appear in all records? If so, there doesn't seem to be a need to include the value in the subform, since it's derived from the main form.


  5. #5
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I guess I was trying to use a subform to get around a query problem. I attached a sample database.

    What I was trying to do is - you open frmMakeAssignment, Select Choice 1 and your choise would eventually end up in tblData field "Assignment"

    It gets a little confusing.

    I start out by importing student names and 5 number choices.
    I convert the number choices to Locations.

    The frmMakeAssignment was designed to allow a teacher to select one of the 5 choices as your assignment.

    I could not get the query to allow you to do all that on one form so I was trying to use a subform to solve the problem.

    Unless you can come up with a suggestion, I will go back and try to approach this another way.

    Thanks.

    Paul
    Attached Files Attached Files

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    I'd set up the database differently. I'll get back to you later today, too little time now.


  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Here is a rather different approach. The choices have been moved to a separate table, and the assignment is selected from a combo box.

    [attachment=86436:Practice.zip]
    Attached Files Attached Files

  8. #8
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hans - Thanks for all your help on this and I like what you put together but as is it will not work for me.

    All the data I am going to work with will come from a spreadsheet that has the fields FN, LN, Grade, Choice1, Choice 2, Choice3, Choice 4, and Choice5. That is the table "tblData" I have to start with.

    I would still appreciate any suggestions you have on how to set this up.

    Paul

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    I'd make the Assignment field numeric, corresponding to Choice1...Choice5 and OrganizationNumber.

    The attached version shows a radically simplified approach using the original table structure, with the exception of the field mentioned above.
    I've done away with most queries and with the subform, and used combo boxes to display the choices and assignment as text.

    [attachment=86452:Practice.zip]
    Attached Files Attached Files

  10. #10
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks.

    I think this approach will work. I'll play with it for awhile.

    Paul

  11. #11
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by pbien View Post
    Thanks.

    I think this approach will work. I'll play with it for awhile.

    Paul
    So far the database is working well. I've added new components. Stuck again.

    On the frmMakeAssignments - What is the correct coding to put in the After Update event of OptChoice to make the subform sbfSummary#AssignmentsA-K update when I change something in OptChoice?

    I have tried several versions of requery but nothing seems to work.

    See attached.

    Thanks.

    Paul
    Attached Files Attached Files

  12. #12
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by pbien View Post
    On the frmMakeAssignments - What is the correct coding to put in the After Update event of OptChoice to make the subform sbfSummary#AssignmentsA-K update when I change something in OptChoice?
    What has to be updated in the subform sbfSummary#AssignmentsA-K ? What field of what record with what value ?
    Francois

  13. #13
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The #assigned field in the subform has to be updated when you check a box in the form.

    Paul

  14. #14
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by pbien View Post
    The #assigned field in the subform has to be updated when you check a box in the form.

    Paul
    What record ? All ?
    And what is the purpose of this because the subform is not linked with the mainform. For each record in the mainform you will change the same record in the subform ? I don't understand.
    Francois

  15. #15
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Francois View Post
    What record ? All ?
    And what is the purpose of this because the subform is not linked with the mainform. For each record in the mainform you will change the same record in the subform ? I don't understand.
    I am trying to show an updated total number of people that have been assigned to each organization. When you make a Choice of an organization there is a query (actually three summary queries)that counts the number of people that have been assigned to each organization. One query for A-K organizations , one for L-R, on for S-Z.

    What I wanted to do is put three subforms on the main form that would show the running totals for each orgaization. I got stuck trying to make the first one work.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •