Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Join Date
    Aug 2007
    Posts
    102

    Unanswered: Command buttons aren't working

    Hello experts,

    I have 3 cmd buttons (undo changes, clear order and save order). They worked great until I added a second subform and moved some controls around...Now I'm having difficulty getting them to work again on either of the subforms, only works ont the main form. The two subforms are bridged together to the Main form through a text control..

    Has any experienced this and can direct me how to get them working again? thanks. Better yet,does anyone have a routine for either cmd button that actually works?

    thanks
    imrosie

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    The buttons are more than likely performatin the action on the bound main form - not the subform.

    Why not post the code behind them and we can take a look.
    George
    Home | Blog

  3. #3
    Join Date
    Aug 2007
    Posts
    102

    Code behind cmd buttons posted as....

    Hi GeorgeV,

    You're right, they're only clearing Main form, not the sub1 and sub2 controls...

    Clear button:
    Uses a 'macro' (left over from the old db, I just kept it because it worked) to goto 'new record'.

    Save button:
    Code:
    Private Sub saveneworder_Click()
    DoCmd.RunCommand acCmdSaveRecord
    End Sub
    Undo button:
    Code:
    Private Sub undochanges_Click()
    DoCmd.RunCommand acCmdUndo
    End Sub
    thanks so much.

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Ok, I don't know if this will work but...
    Have you thought about changing the focus to the subform and then running the commands?

    Pseudo code
    Code:
    Me.MyForm.SetFocus
    DoCmd.RunCommand acCmdUndo
    Me.MySubForm.SetFocus
    DoCmd.RunCommand acCmdUndo
    It's dirty, nasty code, but it might do the trick.
    George
    Home | Blog

  5. #5
    Join Date
    Aug 2007
    Posts
    102

    Wow, that seems strange

    No GeorgeV,

    I hadn't thought of that at all....I think you're saying put this behind the Undo cmd button just to see if it will work?
    Long term, could this cause a problem somewhere else inthe code?...

    Ok GeorgeV, I just tried it with this and typing data into controls on the Main and on 'Order_Ship_Details_Subform':
    Code:
    Private Sub undochanges_Click()
    Me.Order_Ship_Details_Subform.SetFocus
    DoCmd.RunCommand acCmdUndo
    Me.Order_Details_Subform.SetFocus
    DoCmd.RunCommand acCmdUndo
    End Sub
    I immediately got the msg, "you're about to delete 1 record"...(I wasn't expecting that), I clicked OK, then it errored out with this runtime error '2046' that says "the command or action Undo isn't available....

    The one record it deleted was in 'Me.Order_Ship_Details_Subform' only, the data I typed on the Main form is still there. If I could get this to work properly (for clearing the 'old' data on subforms) it could become my "begin new order" cmd button and I could leave my combo box (on Main form for customer name selection) as it is....My concern is that the error msg means it's removing a record from the table and that's not my goal....

    thanks
    Last edited by imrosie; 09-13-07 at 10:38.

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    If you delete the record then you have nothing left to undo!
    I didn't predict that behavior... Hummm - where's PK when you need him

    Back to the drawing board on this one methinks (unless someone else steps in heroically with a new suggestion). I'll perhaps take a look at this too if you upload your db in your other thread suggested (simply provide a link to the upload in this one - no need to upload twice!)

    Oh and please, just call me George
    George
    Home | Blog

  7. #7
    Join Date
    Aug 2007
    Posts
    102

    do you have a V-card?

    Hi George,
    Just call me Rosie...Do you have one so I can compress and email it to you?


    You're right, with 1 record, there is nothing left to Undo, but I put data into 2 controls, one on the
    Main form and some in the Subform

    thanks
    Last edited by imrosie; 09-13-07 at 17:44.

  8. #8
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    What's a V-Card?!
    In one of your other threads I suggested you post a cut-down version of the app... Post that and include the bits relating to this issue too!
    George
    Home | Blog

  9. #9
    Join Date
    Aug 2007
    Posts
    102
    Hi George,

    Essentially is a method allowing me to send you my zip'd or rar'd db in it's entirety via email.

    Wikepedia - file format standard for personal data interchange, specifically electronic business cards. vCards are often attached to e-mail messages, but can be exchanged in other ways, such as on the World Wide Web. They can contain name and address information, phone numbers, URLs, logos, photographs, and even audio clips.

    Anyway, my db is so big, .......but OK,,,,I'll go try to scale it down for attachment. thanks.
    Last edited by imrosie; 09-13-07 at 19:17.

  10. #10
    Join Date
    Aug 2007
    Posts
    102

    OK here it is...I've removed a few things

    hi George,

    I've left the Main form, Add an Order and Details (with tables/queries) and two subforms.....

    I think I've got it pretty much working the way I want it with some minor issues:

    1) Those cmd buttons (Undo, Clear and Save),,,,still have issues

    2.) The Details SubTotal (in Subform on the left)for some reason, error's for a few moments which also causes errors in my 'AOrderTotal' , 'TheOrderTotal' and 'SalesTaxAlone' in Subform on right...... then when I click on the Sales Tax control....the #Error's go away...it's a timing thing I haven't figured out yet.

    Oh well have a go,,,I'll get some P.G. tips whilst you're at it. thanks

    Wait,,,I'm getting a failure a couple times on the upload.
    will try again..
    Rosie

  11. #11
    Join Date
    Aug 2007
    Posts
    102

    I give up....I've tried 6 times

    George, there must be something going on withthe servers (yours I think)...

    This upload keeps giving me a 'failure error',,,,,I 'll try again later on...

    Rosie

  12. #12
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    The file must be zipped up and be <= 10Mb
    George
    Home | Blog

  13. #13
    Join Date
    Aug 2007
    Posts
    102

    The file was zipped and 4.5MB.....

    Hi George,

    I think your servers went down for a bit...I'm going to try again now.


    Just tried again..
    This is the error message I get (it only 4.5MB) and it's zipped and sitting on my desktop...Any ideas???

    TUFF-TapeOrders09-13-07.zip:
    Upload of file failed.

    thanks

  14. #14
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Tell you what Rosie - I will PM you my personal e-mail address to which you can send the file.

    I cannot guarentee I will look at it any time soon (after all, it is nearly the weekend!) but I'll take a peek when I have a spare 10mins.
    George
    Home | Blog

  15. #15
    Join Date
    Aug 2007
    Posts
    102

    Command buttons aren't working ....

    I have 2 command buttons on a Main form, there are 2 subforms. Does anyone know how to make the 'Undo' and 'Clear' functions work simultaneously for all 3 forms? thanks

    Rosie

Posting Permissions

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