Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003

    Unanswered: CommandButton put Qty in a row......

    Hello my friends,i hope i can explain my problem in MsAccess.

    How can i make a Command Button that "OnClick" put a "1" Qty in a qty field
    and if a click 2 times put a "2" or if i click 3 times put a "3" always in the Qty
    field on a row of a selling products details subform ?

    I´ve try the "Find" command but i´m not allow to find anything untill,at least,
    i have a "ProductID" inserted already.I mean,if i have no records in the subform the "Find" does not work.


    ProductId Qty Description Price SubTotal

    I appreciate any possible help.

    Last edited by Claudio_V; 04-21-07 at 12:27. Reason: Grammatical mistake

  2. #2
    Join Date
    Dec 2002
    Préverenges, Switzerland
    i was amazed to discover that there is actually a doubleclick event for a button... thanks for prompting me to look for it.

    unfortunately there is no tripleclick event.

    easiest is to use the ordinary click event and myBox = myBox +1 each time. maybe with a default value=0 as in your post, but possibly a default value=1 makes sense and saves a click.

    currently using SS 2008R2

  3. #3
    Join Date
    Oct 2003
    I solved,the ProductID of a Coke is 1,so :
    DoCmd.GoToControl "[A_Details]"
    DoCmd.GoToControl "ProductID"
    DoCmd.RunCommand acCmdSaveRecord
    DoCmd.FindRecord "1", acEntire, False, , False, acCurrent, True
    If [Forms]![Main]![A_Details]![ProductID] = 1 Then
    DoCmd.GoToControl "Qty"
    [Forms]![Main]![A_Details]![Qty]=[Forms]![Main]![A_Details]![Qty] + 1
    DoCmd.RunCommand acCmdSaveRecord
    DoCmd.GoToControl "[A_Details]"
    DoCmd.GoToRecord , "", acNewRec
    [Forms]![Main]![A_Details]![ProductID] = 1
    [Forms]![Main]![A_Details]![Qty] = 1
    DoCmd.RunCommand acCmdSaveRecord
    End If

Posting Permissions

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