dbTalk Databases Forums  

table field level validation rule help

comp.databases.ms-access comp.databases.ms-access


Discuss table field level validation rule help in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
bobh
 
Posts: n/a

Default table field level validation rule help - 01-27-2009 , 11:26 AM






Hi All,

I trying to setup a validation rule on a table field and I don't seem
to be able to get it to work. I have the field define as number so I
need to detect/capture/display message when a user enters a text
character.
Yes, Access does this but the message it displays will not be useful
or helpful to the end-users so I need to replace it with something
that will make sense.

On the form when I enter a text into the control and press enter, the
following access message appears;

The value you entered isn't valid for this field.
For example, you may have entered text in a numeric field or a number
that is larger than the FieldSize setting permits.

I don't think this is a trapable error message at the form level so I
thought I would set a field validation rule on that field in the
table. All my attempts so far have not worked. I've also tried several
different events on the form but this message always appears when
trying to solve this at the form level.

so, what is the actual syntax for the field validation rule that would
check to be sure the entry is numeric or is not text
thanks
bobh.

Reply With Quote
  #2  
Old   
MGFoster
 
Posts: n/a

Default Re: table field level validation rule help - 01-27-2009 , 01:09 PM






-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You can use the TextBox's KeyDown event - something like this:

Private Sub Text0_KeyDown(KeyCode As Integer, Shift As Integer)

If (KeyCode >= vbKeyA And KeyCode <= vbKeyZ) Then
MsgBox "Outside acceptable characters", vbCritical
KeyCode = 0
End If

End Sub

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSX9b44echKqOuFEgEQJP4ACfbRFHKfMqFk994CjyJDm6Zl E1akYAn0AB
YAsEw/FlW2X9aZ84U9xvmLv0
=5/gg
-----END PGP SIGNATURE-----


bobh wrote:
Quote:
Hi All,

I trying to setup a validation rule on a table field and I don't seem
to be able to get it to work. I have the field define as number so I
need to detect/capture/display message when a user enters a text
character.
Yes, Access does this but the message it displays will not be useful
or helpful to the end-users so I need to replace it with something
that will make sense.

On the form when I enter a text into the control and press enter, the
following access message appears;

The value you entered isn't valid for this field.
For example, you may have entered text in a numeric field or a number
that is larger than the FieldSize setting permits.

I don't think this is a trapable error message at the form level so I
thought I would set a field validation rule on that field in the
table. All my attempts so far have not worked. I've also tried several
different events on the form but this message always appears when
trying to solve this at the form level.

so, what is the actual syntax for the field validation rule that would
check to be sure the entry is numeric or is not text
thanks
bobh.


Reply With Quote
  #3  
Old   
paii, Ron
 
Posts: n/a

Default Re: table field level validation rule help - 01-27-2009 , 04:16 PM



Use the BeforeUpdate event of the control

"bobh" <vulcaned (AT) yahoo (DOT) com> wrote

Quote:
Hi All,

I trying to setup a validation rule on a table field and I don't seem
to be able to get it to work. I have the field define as number so I
need to detect/capture/display message when a user enters a text
character.
Yes, Access does this but the message it displays will not be useful
or helpful to the end-users so I need to replace it with something
that will make sense.

On the form when I enter a text into the control and press enter, the
following access message appears;

The value you entered isn't valid for this field.
For example, you may have entered text in a numeric field or a number
that is larger than the FieldSize setting permits.

I don't think this is a trapable error message at the form level so I
thought I would set a field validation rule on that field in the
table. All my attempts so far have not worked. I've also tried several
different events on the form but this message always appears when
trying to solve this at the form level.

so, what is the actual syntax for the field validation rule that would
check to be sure the entry is numeric or is not text
thanks
bobh.



Reply With Quote
  #4  
Old   
paii, Ron
 
Posts: n/a

Default Re: table field level validation rule help - 01-27-2009 , 04:16 PM



Use the BeforeUpdate event of the control

"bobh" <vulcaned (AT) yahoo (DOT) com> wrote

Quote:
Hi All,

I trying to setup a validation rule on a table field and I don't seem
to be able to get it to work. I have the field define as number so I
need to detect/capture/display message when a user enters a text
character.
Yes, Access does this but the message it displays will not be useful
or helpful to the end-users so I need to replace it with something
that will make sense.

On the form when I enter a text into the control and press enter, the
following access message appears;

The value you entered isn't valid for this field.
For example, you may have entered text in a numeric field or a number
that is larger than the FieldSize setting permits.

I don't think this is a trapable error message at the form level so I
thought I would set a field validation rule on that field in the
table. All my attempts so far have not worked. I've also tried several
different events on the form but this message always appears when
trying to solve this at the form level.

so, what is the actual syntax for the field validation rule that would
check to be sure the entry is numeric or is not text
thanks
bobh.



Reply With Quote
  #5  
Old   
paii, Ron
 
Posts: n/a

Default Re: table field level validation rule help - 01-27-2009 , 04:16 PM



Use the BeforeUpdate event of the control

"bobh" <vulcaned (AT) yahoo (DOT) com> wrote

Quote:
Hi All,

I trying to setup a validation rule on a table field and I don't seem
to be able to get it to work. I have the field define as number so I
need to detect/capture/display message when a user enters a text
character.
Yes, Access does this but the message it displays will not be useful
or helpful to the end-users so I need to replace it with something
that will make sense.

On the form when I enter a text into the control and press enter, the
following access message appears;

The value you entered isn't valid for this field.
For example, you may have entered text in a numeric field or a number
that is larger than the FieldSize setting permits.

I don't think this is a trapable error message at the form level so I
thought I would set a field validation rule on that field in the
table. All my attempts so far have not worked. I've also tried several
different events on the form but this message always appears when
trying to solve this at the form level.

so, what is the actual syntax for the field validation rule that would
check to be sure the entry is numeric or is not text
thanks
bobh.



Reply With Quote
  #6  
Old   
Earl Anderson
 
Posts: n/a

Default Re: table field level validation rule help - 01-27-2009 , 04:52 PM



For what 'bobh' is trying to accomplish (understandable language for his
users), instead of < MsgBox "Outside acceptable characters", > wouldn't
verbiage such as <MsgBox "Enter only numbers here" > be preferable?

JM2c...
Earl

"MGFoster" <me (AT) privacy (DOT) com> wrote

Quote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You can use the TextBox's KeyDown event - something like this:

Private Sub Text0_KeyDown(KeyCode As Integer, Shift As Integer)

If (KeyCode >= vbKeyA And KeyCode <= vbKeyZ) Then
MsgBox "Outside acceptable characters", vbCritical
KeyCode = 0
End If

End Sub

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSX9b44echKqOuFEgEQJP4ACfbRFHKfMqFk994CjyJDm6Zl E1akYAn0AB
YAsEw/FlW2X9aZ84U9xvmLv0
=5/gg
-----END PGP SIGNATURE-----


bobh wrote:
Hi All,

I trying to setup a validation rule on a table field and I don't seem
to be able to get it to work. I have the field define as number so I
need to detect/capture/display message when a user enters a text
character.
Yes, Access does this but the message it displays will not be useful
or helpful to the end-users so I need to replace it with something
that will make sense.

On the form when I enter a text into the control and press enter, the
following access message appears;

The value you entered isn't valid for this field.
For example, you may have entered text in a numeric field or a number
that is larger than the FieldSize setting permits.

I don't think this is a trapable error message at the form level so I
thought I would set a field validation rule on that field in the
table. All my attempts so far have not worked. I've also tried several
different events on the form but this message always appears when
trying to solve this at the form level.

so, what is the actual syntax for the field validation rule that would
check to be sure the entry is numeric or is not text
thanks
bobh.




Reply With Quote
  #7  
Old   
bobh
 
Posts: n/a

Default Re: table field level validation rule help - 01-28-2009 , 09:09 AM



this did the trick, thanks for your help........
although I did change the message text to something I thought my end
users would understand.....

On Jan 27, 2:09*pm, MGFoster <m... (AT) privacy (DOT) com> wrote:
Quote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You can use the TextBox's KeyDown event - something like this:

Private Sub Text0_KeyDown(KeyCode As Integer, Shift As Integer)

* * *If (KeyCode >= vbKeyA And KeyCode <= vbKeyZ) Then
* * * * *MsgBox "Outside acceptable characters", vbCritical
* * * * *KeyCode = 0
* * *End If

End Sub

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. *I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSX9b44echKqOuFEgEQJP4ACfbRFHKfMqFk994CjyJDm6Zl E1akYAn0AB
YAsEw/FlW2X9aZ84U9xvmLv0
=5/gg
-----END PGP SIGNATURE-----



bobhwrote:
Hi All,

I trying to setup a validation rule on a table field and I don't seem
to be able to get it to work. I have the field define as number so I
need to detect/capture/display message when a user enters a text
character.
Yes, Access does this but the message it displays will not be useful
or helpful to the end-users so I need to replace it with something
that will make sense.

On the form when I enter a text into the control and press enter, the
following access message appears;

The value you entered isn't valid for this field.
For example, you may have entered text in a numeric field or a number
that is larger than the FieldSize setting permits.

I don't think this is a trapable error message at the form level so I
thought I would set a field validation rule on that field in the
table. All my attempts so far have not worked. I've also tried several
different events on the form but this message always appears when
trying to solve this at the form level.

so, what is the actual syntax for the field validation rule that would
check to be sure the entry is numeric or is not text
thanks
bobh.- Hide quoted text -

- Show quoted text -


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.