Page 1 of 2 12 LastLast
Results 1 to 15 of 28
  1. #1
    adilos is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    14

    run button countinous form with one click

    hello everybody,



    i need your help pleas.

    i hav countinous form with button for every record, wich has a VBA code. my question is. i want to put Button in header form, when i click it, then should run all button in countinous form. how can i do that.

    thanx in advance

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by adilos View Post
    ...all button in countinous form...
    Controls in Continuous forms are only good for the Current or Active record/row. I do not recommend using controls in the detail of Continuous forms.

  3. #3
    SMC's Avatar
    SMC is offline Master Ninja
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    Columbus, OH
    Posts
    28
    You could always have the VBA run AfterUpdate of the last item that gets filled in for each record.
    Basically just get rid of the command button and do it automatically. Since you want a button that updates it all at once, I suppose it won't matter that it occurs automatically.

  4. #4
    adilos is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    14
    yes u r right, bnut in my situation i miss use countinous form

  5. #5
    adilos is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    14
    hallo Ninja,

    u meant that i muss put the vba-code in the Button "After Update" and not in "ON click", and when i will load the counitinous form, all buuton, will run automatically???

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,944
    First of all, please understand there is only ONE button, as can be seen in design view. If the button is in detail section, it is replicated for each record in continuous view but it is still the SAME button. What exactly does this button do? If you just want to set the value of a field in every record to True or False, then have the code run an UPDATE sql and refresh the form

    CurrentDb.Execute "UPDATE tablename SET fieldname=True"
    Me.Refresh
    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.

  7. #7
    adilos is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    14
    hello thax for reply,

    my vba code copy the record. So in countinous form i mus click all button and i dont want that. there is no way, how it can run all button automatically, when the form it loaded. it means for exampl the button muss be automatically clicked



  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,944
    Again, there is only ONE button - there is no 'all button'. You now want a button that will copy all the records? Copy them where - into the same table? Why would you want to copy all the records? Is this form opened to a filtered set of records?
    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
    adilos is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    14
    yes exactly this form opened to a filtered set of records. how can i do that pleas automaticlly. and i want to that in this form not in table?? do hav any idea???

  10. #10
    SMC's Avatar
    SMC is offline Master Ninja
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    Columbus, OH
    Posts
    28
    Quote Originally Posted by adilos View Post
    u meant that i muss put the vba-code in the Button "After Update" and not in "ON click", and when i will load the counitinous form, all buuton, will run automatically???
    No, I was suggesting that you just remove the button and either make a global button in the form header/footer, or just have the last entry to each record, whether it be a text box, check box, tic box, combo box, a note to Santa Claus or w/e it is run the VBA after update. Once that field is updated have the VBA commence.

    Do this by clicking on the last field to be updated per record in design mode and going to the properties and adding in an event that in the AfterUpdate section.

  11. #11
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,944
    What do you mean 'not in table'? How can you copy records without saving to table?

    Language barrier very wide.

    Maybe with button in form header, VBA code:

    CurrentDb.Execute "INSERT INTO tablename " & Me.RecordSource

    This assumes:

    1. no unique ID fields, no autonumber field

    2. form RecordSource is an SQL statement.

    If these assumptions not true, this can get much more complicated.
    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.

  12. #12
    adilos is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    14
    pleas just think about that. i want when my counitnous form loaded should the button run. or one button in header form when i click it, should be run buttons in countinous form. . thnax in advance

  13. #13
    SMC's Avatar
    SMC is offline Master Ninja
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    Columbus, OH
    Posts
    28
    is it possible to upload the database? save a copy of it, delete all the data out of it and upload it to the thread. It's difficult to understand what exactly you are trying to do. I feel that myself and June7 have answered your question with several possible routes.

  14. #14
    adilos is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    14
    i dont hav problem with my vba-code. my vba- code run very good when i click the button. Pleas just thinck about that. when my form it opened then i muss click all button to copy all records(my VBA-Code it is to complex to describe it here). now My Problem it is (Pleas thinck just about THAT), i want when my counitnous form loaded should the button run. or one button in header form when i click it, should be run all buttons in countinous form. Just that. it is 100% easy for u

  15. #15
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,944
    There are no 'buttons' (plural) in the continuous form detail section. There is only one button and it has the same code for all records. CANNOT make another button in header run the 'buttons' in the detail section because there is only one button in the detail section.

    So please, stop asking for code that will 'run buttons in continuous form'.

    Just tell us what is the final result you want.
    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.

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

Similar Threads

  1. Replies: 6
    Last Post: 11-18-2013, 12:03 PM
  2. Replies: 3
    Last Post: 10-04-2012, 01:33 PM
  3. Replies: 1
    Last Post: 03-31-2012, 01:38 PM
  4. On Click Event For Button On Form
    By Desstro in forum Forms
    Replies: 3
    Last Post: 08-09-2010, 02:36 PM
  5. VB coding for saving when click on save button in form
    By cwwaicw311 in forum Programming
    Replies: 1
    Last Post: 02-04-2010, 11:11 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