Required Field based on another Field

J

jlo

I have a field "Issue Resolved" that is a checkbox. Is there a way to set
this field when it is checked to go to the field "Date Resolved" and make
that field required so the user has to type a date in the field?

I can only make this field required if the issue was resolved.

Thanks for all your help in advance!!
 
R

Ryan

Try this.

Private Sub Issue_Resolved_AfterUpdate()
If Me.Issue_Resolved = True Then
DoCmd.GoToControl "Date Resolved"
Me.Date_Resolved.Required = True
End If
Exit Sub
 
A

Allen Browne

Remove the [Issue Resolved] field from your table.

Create a query using this table, and type this into the field row:
IssueResolved: ([Date Resolved] Is Not Null)
Access will automatically populate this field for you when the date is
entered. It solves all the validation issues, and the data can never be
wrong.

Just use the query anywhere where you want this field (e.g. as the source of
a form, a report, ...)
 
J

jlo

Thank you for the suggestion. When I create fields, I do not put spaces in
the field names. Unfortunately this person doesn't know Access to well and
put spaces in the field names. I will see if it works. Thanks.
 
J

jlo

Thank you too. This does work as the last post does. I also like Allen's
suggestion and will see if the customer wishes to try that.
 
J

jlo

I'm loving this idea and will present to the user. Thank you to all of you!

Allen Browne said:
Remove the [Issue Resolved] field from your table.

Create a query using this table, and type this into the field row:
IssueResolved: ([Date Resolved] Is Not Null)
Access will automatically populate this field for you when the date is
entered. It solves all the validation issues, and the data can never be
wrong.

Just use the query anywhere where you want this field (e.g. as the source of
a form, a report, ...)

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

jlo said:
I have a field "Issue Resolved" that is a checkbox. Is there a way to set
this field when it is checked to go to the field "Date Resolved" and make
that field required so the user has to type a date in the field?

I can only make this field required if the issue was resolved.

Thanks for all your help in advance!!
 

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