I have an existing field on a form which I need to make a required field. I have added a messagebox, which shows up constantly, even between the user entering characters in the text box. Can someone please provide code or tell me how to fix this? Thank you in advance!
pbaldy
04-25-2007, 09:12 AM
Well, you have given us the code or where it is, but given the description it sounds like you have it in the change event, and you probably want it in the before update event, and you'd want a cancel = true if the test fails.
I put my code in the before update event and it works perfectly now, thank you:) Now my next mission is to only allow valid email address formats in that textbox. I don't know if you can provide me with some help on that matter?
pbaldy
04-25-2007, 09:40 AM
I've seen any number of methods, from simply making sure there's an "@" in the string, to regular expressions that do a fairly complete validation. I use the latter, but if you search here you should several methods.
Would you be able to provide sample code of the latter? I would greatly appreciate it! I tried searching here and only found the test for @.
pbaldy
04-25-2007, 09:55 AM
I found several, here's one:
http://www.access-programmers.co.uk/forums/showthread.php?t=97663