Hi,
I am having a bit of trouble with validation in Microsoft Access and Visual Basic. Basically, I have created some validation rules in Access (which work fine), and I have made a data environment in VB to link the two together. I go to add a record from within the UI I designed in VB, and I get a validation error (the custom one I set in Access) thrown back in my face.
For the StudentID (example StudentID would be "JONESP"), I have used a validation rule of:
Like "[A-Z][A-Z][A-Z][A-Z][A-Z][A-Z]" (which works fine in VB and Access).
For the StudentPostCode (example postcode would be: "L21 7TC") I have used a validation rule of:
Like "[A-Z]##[ ]#[A-Z][A-Z]" (which I get an error on in VB, even though it works find in Access)
Fort the StudentPhoneNumber (example phone number would be: "0151 2874012") I have used a validation rule of:
Like "####[ ]#######" (which I get an error with in VB, but again this works find in Access)
So I am a bit puzzled with the way in Access the data I enter conforms with the validation rules I set, but if I enter the same data in Visual Basic I get the validation error message I made thrown at me? This is confusing and happens for all the validation except for the StudentID - confusingly. So for some reason I am doubting that my validation rules are correct?
So can anyone help me with this please? Quickly if possible, as I do have a deadline to meet
Thank you very much kind Sir's
I am having a bit of trouble with validation in Microsoft Access and Visual Basic. Basically, I have created some validation rules in Access (which work fine), and I have made a data environment in VB to link the two together. I go to add a record from within the UI I designed in VB, and I get a validation error (the custom one I set in Access) thrown back in my face.
For the StudentID (example StudentID would be "JONESP"), I have used a validation rule of:
Like "[A-Z][A-Z][A-Z][A-Z][A-Z][A-Z]" (which works fine in VB and Access).
For the StudentPostCode (example postcode would be: "L21 7TC") I have used a validation rule of:
Like "[A-Z]##[ ]#[A-Z][A-Z]" (which I get an error on in VB, even though it works find in Access)
Fort the StudentPhoneNumber (example phone number would be: "0151 2874012") I have used a validation rule of:
Like "####[ ]#######" (which I get an error with in VB, but again this works find in Access)
So I am a bit puzzled with the way in Access the data I enter conforms with the validation rules I set, but if I enter the same data in Visual Basic I get the validation error message I made thrown at me? This is confusing and happens for all the validation except for the StudentID - confusingly. So for some reason I am doubting that my validation rules are correct?
So can anyone help me with this please? Quickly if possible, as I do have a deadline to meet

Thank you very much kind Sir's
