Validating Textbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I´m buildin a simple form from a table that contain two fields, Id and Name.
What a need to do is to put the cursor in the Id field (TextBox) and it
statys there every time the users jump to another record.

In the same textbox need to validate against null or balnk spaces and statys
the crusor there if so.

Thanks in advance
 
In the form's Current event:

Me.ID.SetFocus

And to test it for nulls or blanks
If len(trim(nz(Me.ID,vbNullstring))) = 0 then msgbox "Id is Not Valid"
 
Thanks a lot!
--
César Parrales


Klatuu said:
In the form's Current event:

Me.ID.SetFocus

And to test it for nulls or blanks
If len(trim(nz(Me.ID,vbNullstring))) = 0 then msgbox "Id is Not Valid"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top