Making form fields required

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.
 
T

tina

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
 
C

Cheese_whiz

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".
 
Top