Results 1 to 2 of 2

Thread: Mask Edit boxex

  1. #1
    Guest

    Exclamation

    Background:

    I'm using a DAO and on my form I also have a couple Masked Edit Boxes. (postal code, phone number credit card number, CC expiry date and a business phone number; yeah... its for a customer table...

    Currently I have the code in a seperate sub routine which is called at the end if the form_Activate routine.

    When my Apply_Mask sub is fired, the application of the masks also causes the DAO to think that is going into edit mode. The tricky thing about this is that I also have a Data Class because on three forms, all the buttons are the exact same and I'm going for top marks in my final programming project for my college graduating semister... but back to the problem...

    Question:

    How can I get the masks to apply to the Mask Edit Boxes and not have the DAO think that is in edit mode?

    Please let me know as soon as possible because my projecxt is due this friday morning and I still have a lot to do...

    Thanks,

    Brad Bassingthwaite

  2. #2
    Guest

    Talking I found my answer!!!

    I almost feel like I just had an orgasm after working on this one problem for the last 16 hours straight....


    Just in case anyone might be curious...

    After aplying the mask commands:

    object.mask = ""
    object.text = ""
    object.mask = ">#?# ?#?" '(canadian postal code)
    object.seltext = !Postal '(database field name)
    object.datachanged = false

    The datachanged property switches the dbeditmode to false so that your DAO thinks that the data hasn't changed at all.

    Just this one simple line makes the world of difference.

    By the way... I've only begun teaching myself VB about 2 weeks ago... that''s why I'm so happy that I found the answer.

    Best of luck to everyone!

Posting Permissions

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



Click Here to Expand Forum to Full Width