Making form fields required

  • Thread starter Thread starter iwasinnihon
  • Start date Start date
I

iwasinnihon

I am trying to figure out how to make a button check to make sure that
a selection has been made on a combo box and that text has been entered
into a text field. I do not understand how to code this. If anyone
could help me out with some simple code that would check for this, I
would appreciate it.
 
try

If IsNull(Me!ComboboxName) Then
<what do you want to happen?>
ElseIf IsNull(Me!TextboxName) Then
<what do you want to happen?>
Else
<do you want something to happen when
both are entered?>
End If

hth
 
Depends on what you want to do, but the easiest way to make a form field
required is by setting the property in the underlying table to required. You
do that by going to the table, opening it in design view, clicking in the
appropriate field at the top, and then looking at the bottom in the
properties area and changing the "required" to "yes".
 

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