Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text Field 2

Status
Not open for further replies.

ChrisBair

Technical User
Mar 17, 2004
32
US
How do you make a Text Field on a form a Requirement. Where when entering data, one must fill in that field before you can go to the next one.

Thanks
 
have a look at
thread702-842638

Hope this helps
Hymn
 
Is this a bound form and is the textbox a bound control? If this is true then at the table level you can change the field to a required field by changing the Required property to Yes. If the user enters all the data on the form and then tries to save or go to a new record ACCESS will pop a message up to make the user fill in the field.

Is this what you were looking for or do you want this all taken care of on the form with code?

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
Chris'
Or, you can go to the design of the table and at the bottom of the screen are the options. Select your text field and then select "Required", "yes"
jim
 
It is a Text Field control source to the table. Field is"RA#" I Tried

Private Sub Form_BeforeUpdate(Cancel As Integer)

Dim strMSG as String

strMSG = "Please enter a value for YourRequirement"

If Nz(Me.RA#)= 0 Then


MsgBox strMSG
Cancel = True
Me.RA#.SetFocus

End If

However I get a Compile error - Method or dataq member not found
 

change
If Nz(Me.RA#)= 0 Then
If isnull me.ra# then

Hope this helps
Hymn
 
Changed it to

If isnull me.RA# then

And I receive Error : Compile error Syntax error
 
Hi!

[tt]if nz(Me![RA#]) = 0 then ' or
if isnull(Me![RA#]) then[/tt]

- for field/control names containing spaces or special characters - surround them in [brackets]

Roy-Vidar
 
RoyVidar is right I forgot the () sorry

Hope this helps
Hymn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top