Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2003
    Posts
    2

    Unanswered: Check Boxes duplicating entered data

    I have created a form to collect customer data (i.e., address, phone, city, state, etc.). I have two places to collect the data on the form, one for billing info & one for shipping info. I would like to be able to check a box if the the billing address is the same as the shipping address & upon checking the box, it copies the data entered from "shipping" to "billing". Any info would help.

    Thanks in advance.

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    i'm not convinced by the use of a checkbox to achieve this: the meaning of checking the checkbox is clear, but how should unchecking a previously checked checkbox be handled?

    anyway, to answer the question as posed:
    in checkbox_afterupdate()
    if checkbox.value then
    billtoCo.value = shipptoCo.value
    billtoAd1.value = shiptoAd1.value
    'etc
    else
    msgbox "What to do now?",vbquestion,"Confused!"
    endif
    end sub

    an alternative strategy might be to store the checkbox value in your table: if checked, hide the BillTo part of the form and don't bother saving the BillTo details at all. this avoids the nasty possibility of someone editing one of the two adresses when they are both supposed to be the same!

    izy

  3. #3
    Join Date
    Sep 2003
    Posts
    2
    Thansk for the advice. That sounds like a better plan of action. I would need to still show both address types on the form, but when it is checked, it would hide the details. Right.

    Thanks,

    vwalla

    Originally posted by izyrider
    i'm not convinced by the use of a checkbox to achieve this: the meaning of checking the checkbox is clear, but how should unchecking a previously checked checkbox be handled?

    anyway, to answer the question as posed:
    in checkbox_afterupdate()
    if checkbox.value then
    billtoCo.value = shipptoCo.value
    billtoAd1.value = shiptoAd1.value
    'etc
    else
    msgbox "What to do now?",vbquestion,"Confused!"
    endif
    end sub

    an alternative strategy might be to store the checkbox value in your table: if checked, hide the BillTo part of the form and don't bother saving the BillTo details at all. this avoids the nasty possibility of someone editing one of the two adresses when they are both supposed to be the same!

    izy

  4. #4
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    it's a matter of taste whether you actually store the billto AND the sellto if they are the same. personally, i would not! whenever supposedly duplicate data exists, there is the risk that it gets out of sync.

    imagine your same yes/no stored in field [SnBsame]
    you can always recover billto stuff for reports etc using something along the lines of:
    = iif([SnBsame], [SellToCo], [BillToCo])

    izy

Posting Permissions

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