Results 1 to 11 of 11
  1. #1
    hwong is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2012
    Posts
    13

    Question Update Main form control value into Subform control

    Hi Everyone,
    I have a question about updating main form value into sub-form. The background is:
    Main form:
    ComboboxA (01-10)
    SubformB
    TextboxC

    Sub-form (01 - 10):
    TextboxD (Difference control name in 01-10, but standard, say 01remark, 02remark, 03remark etc...):



    Depends on value selected in ComboboxA, one of the subform 01-10 will be called out. Here is my code:
    Code:
    With Child01
        If ComboboxA <> "" Then
            .SourceObject = ComboboxA
        Else
            .SourceObject = ""
        End If
    End With
    Since I do not set a fixed subform, I cannot set Textbox C = TextboxD.

    Would anyone help on this problem?

    Thanks in advance!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Why are there multiple forms playing 'musical chairs' for the subform control?

    Don't understand what TextboxC and TextboxD are for - PK/FK link?

    The main form is bound? Maybe set the Master/Child links properties?
    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.

  3. #3
    hwong is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2012
    Posts
    13
    Thanks for your reply!

    The reason for playing "musical chair" is reducing time for searching the right form / table to update (what I want). Also, it reduces the size of main form not to show 10 forms altogether!

    Sorry that I don't know the meaning of PK/FK links. My idea, is to update a textbox control on main form and to update the same content to another textbox control on a subform at the same time. My difficulty is that my subform source object is not fixed......so I cannot set Forms!mainform.textboxA = Forms!subform.textboxB.

    Any methods? Please help. Thanks in advance again!

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    PK = Primary Key
    FK = Foreign Key

    Once you change the subform SourceObject property, set the Master/Child links properties.

    Actually never tried a dynamic subform so not quite sure that will work but seems reasonable.
    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.

  5. #5
    hwong is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2012
    Posts
    13
    Thanks June7. However, I have already linked another field. For better understanding, I have attached my database. I just want to copy the remark from "FormSummaryTable" to TableA ~ D when a record is added.

    It frustrates me a lot. It seems Access is quite useless.
    Attached Files Attached Files

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    To help us understand your database and frustration could tell us what the database is about?
    What is the Business it supports? Can you tell us about your tables and relationships?

    I think a lot of your frustration is related to this
    Sorry that I don't know the meaning of PK/FK links.
    .
    For your own benefit and to reduce your frustration, I recommend you do some research and some practice exercises on
    database design and Normalization. There is a design component that is often overlooked, or not recognized by new users of database software such as Access. Consider the analogy of building a house, proper use of hammers, saws and equipment is import, but I think you would agree that a plan or blueprint; even an artist's conception of the house is key.

    So here are some links that should help with the design and concepts.
    http://forums.aspfree.com/attachment...2&d=1201055452
    http://www.rogersaccesslibrary.com/T...lationship.zip

    The sooner you learn Normalization and the meaning of PK/FK, the sooner you reduce the frustration level.
    Then your frustration will be with naming conventions and statement syntax. But that's down the road.

    Good luck.

  7. #7
    hwong is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2012
    Posts
    13
    Thanks Orange.

    I know there is a duplication in "Remark" data, but it is "straight forward" to me to store this value in two data table. I think Access could do it easily, like Excel copy and paste. That's why I am frustrated. Hmm......if no possible way to solve my question, I will try other ways.

    Thanks June7 and Orange.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    It is possible to copy value in multiple tables but I am totally baffled that you consider this a benefit in your db design. There can be justification for duplication such as when prices are subject to change over time and is necessary that the prices associated with existing records are not altered. But to duplicate remark makes no sense to me.

    I cannot review your db until after Feb 22. If you still need assistance after then submit a 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.

  9. #9
    hwong is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2012
    Posts
    13
    I solved my problem. It is quite simple in fact.

    Thanks all again.

  10. #10
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    Actually never tried a dynamic subform so not quite sure that will work but seems reasonable.
    Think you can only change things like this at the form open event and not at the form load event.

    It frustrates me a lot. It seems Access is quite useless.
    There's a saying about bad workmen blaming their tools.

  11. #11
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Quote Originally Posted by hwong View Post
    I solved my problem. It is quite simple in fact.

    Thanks all again.
    Hwong, please post your solution to help anyone with similar problem.
    thanks.

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

Similar Threads

  1. Replies: 26
    Last Post: 08-27-2012, 12:12 PM
  2. Replies: 3
    Last Post: 03-29-2012, 12:40 PM
  3. Subform control via main form (or better option)
    By dwnocturnal in forum Forms
    Replies: 14
    Last Post: 11-05-2011, 11:24 AM
  4. Subform in a Tab Control on a Main form
    By jpkeller55 in forum Access
    Replies: 4
    Last Post: 01-08-2011, 12:31 PM
  5. Linking Subform Control to Main form
    By KWarzala in forum Forms
    Replies: 1
    Last Post: 03-13-2010, 08:32 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