Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2010
    Location
    UK
    Posts
    160

    Unanswered: Check button which zero outs a field

    Hello again...nearly the weekend.

    within my form I'm trying to create a check box which when selected writes a '0' to my price field, then makes visible a box saying 'Included'

    It's a quotation database and sometimes we throw in items for free!!! and say it's included within the price.

    Any ideas if it can be done?.

    I've managed to get make a text box visible (wow you might say) but not managed to set the price field to zero.

    cheers
    marcus
    Last edited by marcusmacman; 11-15-10 at 10:41.

  2. #2
    Join Date
    Aug 2009
    Location
    Up Nort' Wi
    Posts
    140
    Something like this?


    ChkBox_OnClick

    If ChkBox then
    IncludedLabel.Visible = True
    TxtPrice = 0
    Else
    IncludedLabel.Visible = False
    Endif

    End Sub


    Sam, hth
    Good, fast, cheap...Pick 2.

  3. #3
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    You'll have to include the part about the label visibility in the Form_Current event as well, in order for it to persist, record to record:
    Code:
    Private Sub Form_Current()
    If ChkBox Then
     IncludedLabel.Visible = True
    Else
      IncludedLabel.Visible = False
    End If
    End Sub
    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    Join Date
    Sep 2010
    Location
    UK
    Posts
    160
    thanks for looking into it for me .

  5. #5
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    That's why we're here!
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  6. #6
    Join Date
    Sep 2010
    Location
    UK
    Posts
    160
    hi there,

    I tried the code but it didn't change the List_Price field. No errors were thrown up, it just didn't change. I've tried writing to the record source but that didn't work either.

    I'm thinking i need to update the List_Price field just for that record somehow? Update query? to set it to 0.
    cheers
    marcus

  7. #7
    Join Date
    Sep 2010
    Location
    UK
    Posts
    160
    not quite there.

    I've created an update query based on the table which holds the Price_List. I can't seem to reference the current record in my subform. A box pops up asking me to select the record number. Does anyone know how to reference the current record on a subform so I can use it in my query?
    cheers
    marcus
    Last edited by marcusmacman; 11-15-10 at 16:23.

Posting Permissions

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