Results 1 to 13 of 13
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dirtying Master Fields (2003)

    I'd like the end-user to be able to fill out the subforms text boxes without having to fill out the text boxes on the main startup form of the attached mdb.
    I thought using
    <font color=448800>Me.Parent.Form.Dirty</font color=448800>
    in the BeforeUpdate event of each subform should do the job but why, when I start filling out the subforms text boxes, do I get the message the
    object doesn't support this property or method?

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dirtying Master Fields (2003)

    Giorgio,

    You have to use :
    Me.Parent.Form.Dirty = True

    and the cursor has to be on the form you want to set dirty in a modifiable control.
    So you'll have to write some code with SetFocus to move the cursor to the parent form, set it Dirty and move back to the subform.
    Francois

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dirtying Master Fields (2003)

    Thank you Francois, I've carried out your suggestion but why can't the Testo134 text box on the main form get the focus since I've enabled it while it can if I put a breakpoint at the line
    <font color=448800>Me.Parent.Form.Testo134.SetFocus</font color=448800>
    and proceed from there?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Dirtying Master Fields (2003)

    If you enter items in the subform before entering data in the main form, the value of Giorno will be null. Since this is the field that links the main form and the subforms, you'll run into problems as soon as you try to save a subform record.

  5. #5
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dirtying Master Fields (2003)

    Hi Hans, thank you.
    For the mdb in question, the startup form opens on October 1st. Isn't it possible, upon opening the main form(Dezzo), to automatically fill the Giorno field in the main form record source(the PortDez23 table) with the date shown on the calendar without having to necessarily fill out the two text boxes on the main form so that the user can go on to fill out the subforms?

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Dirtying Master Fields (2003)

    Sorry, I am not able to help you. As soon as I try to modify the database, Access crashes.

  7. #7
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dirtying Master Fields (2003)

    Can you please try with the attached one?

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Dirtying Master Fields (2003)

    Still crashes.

  9. #9
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dirtying Master Fields (2003)

    <img src=/S/bummer.gif border=0 alt=bummer width=15 height=15>
    Can you please tell me what modifications you were planning on doing so that I can try them out?

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Dirtying Master Fields (2003)

    There is a problem with the link between the main form and the subforms. If you make the Giorno control on the first subform visible, you'll see that it doesn't get set if you select a date in the calendar control. So I wanted to see if changing the name of CData to Giorno, or else changing the Master Link Fields property of the subforms to CData would cause Giorno on the subforms to be set. However, this causes Access to crash when the main form is opened.

  11. #11
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dirtying Master Fields (2003)

    You're right Hans, as soon as I try and set the Link Master Fields to Cdata, Access crashes.
    So I've eliminated two pages of the tab control in order to zero in on the problem.
    You can now see that I've made the Giorno control on the first subform visible and now it does get set if you select a date in the calendar control and you bypass the Current event of the MG1Dez subform; so what causes Access to crash is the code for the Current event of the MG1Dez subform although I cannot see what is wrong with it, can you?

  12. #12
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Dirtying Master Fields (2003)

    I'm sorry, I've already told you in <post#=524,203>post 524,203</post: > that I don't understand the code.

  13. #13
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dirtying Master Fields (2003)

    <img src=/S/blush.gif border=0 alt=blush width=15 height=15>It's ok Hans,
    I've been able to solve it by cutting all the subforms Current events code, set the subforms Link Master Fields to Cdata and pasting the Current events code back.
    Looks like dealing with Access requires also some artistic inclination. <img src=/S/artist.gif border=0 alt=artist width=34 height=29>

Posting Permissions

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