VBA set Textbox to be required

Rania01

Member
Local time
Today, 10:35
Joined
Oct 9, 2021
Messages
59
Dear all,

How to programatically set Textbox to be required?
If value on Status on the textbox Datum must be required

Thank you in advance
photos.jpg
 
Is the form bound? If so, it might be easier to just set the field in the table as required. Otherwise, the common approach is to use the form's BeforeUpdate event to validate the form and make sure required fields are entered.
 
I use textbox unbound, I would like only the Datum must be required if user select value on Status
if on status is empty on the datum not required

Thank you
 
I use textbox unbound, I would like only the Datum must be required if user select value on Status
if on status is empty on the datum not required

Thank you
Wouldn't it make more sense to have the status first then?
 
I agree with Gasman, resequencing the controls makes more sense. You can even hide/show the optional field if that would be useful. BUT as the others have already mentioned, the form's BeforeUpdate event is where the validation must go.

If you are using unbound forms, you are not using Access to your best advantage and should probably be using a different development platform.
 

Users who are viewing this thread

Back
Top Bottom