checking for empty fields

G

Guest

Create a function within the form that check if the fields has data

Function CheckField() As Boolean
If IsNull(Me.[Field1]) Or IsNull(Me.[Field2]) Or IsNull(Me.[Field3]) Then
CheckField = False
Else
CheckField = True
End if
End Function

================
On the After Update event of each relavant field, run the code

Me.[ButtonName].Enabled = CheckField
 
G

Guest

Where should I put the function?

Thank you very much!

Ofer Cohen said:
Create a function within the form that check if the fields has data

Function CheckField() As Boolean
If IsNull(Me.[Field1]) Or IsNull(Me.[Field2]) Or IsNull(Me.[Field3]) Then
CheckField = False
Else
CheckField = True
End if
End Function

================
On the After Update event of each relavant field, run the code

Me.[ButtonName].Enabled = CheckField

--
Good Luck
BS"D


segurarl said:
Using a form, how can I make the OK available only after some fields have data?
 
G

Guest

Sorry it took me a while to come back to you
Put the function within the form (open the form in design view, in the menu
bar select View > Code), not in a module.

--
Good Luck
BS"D


segurarl said:
Where should I put the function?

Thank you very much!

Ofer Cohen said:
Create a function within the form that check if the fields has data

Function CheckField() As Boolean
If IsNull(Me.[Field1]) Or IsNull(Me.[Field2]) Or IsNull(Me.[Field3]) Then
CheckField = False
Else
CheckField = True
End if
End Function

================
On the After Update event of each relavant field, run the code

Me.[ButtonName].Enabled = CheckField

--
Good Luck
BS"D


segurarl said:
Using a form, how can I make the OK available only after some fields have data?
 

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

Top