Thanks Pat I am new to VBA and have mostly worked by copying existing code and changing it to fit my needs. I think I am having a hard time combining codes.
If this is my code:
Private Sub CatalogID_AfterUpdate()
If DCount("[CatalogID]", "Course_tbl", "[CatalogID]= '" & Me![CatalogID] &...
I do have the field in the table indexed, but it wont notify them that it is a duplicate record until they have completed all fields on the form. I was trying to make a notification happen after the first field entry, which is the field that cannot be duplicated.
Thanks Pat, but in this case, I do want to clear the data so the user can make a new entry without having to delete what they have previously typed. It is not a big deal to have them delete the entry. I was hoping to automate the process.
No, I am not looking for duplicates. The user enters a new course in the catalog, I just want a popup to display letting them know if they have made a duplicate entry. If they have made a duplicate entry I wanted the field to clear once they clicked the ok button.
Guys, I have this code to display a message box if the field entry is a duplicate. I would like to add code to clear the field entry if OK is clicked. I don't know how to do that.
Private Sub CatalogID_AfterUpdate()
If DCount("[CatalogID]", "Course_tbl", "[CatalogID]= '" & Me![CatalogID] &...
Thank you. I do get the concept. The calculated fields are only needed for the report. So really I will not need to create a table based on the query, Just the report. Thank you.
So, if I understand... Remove those calculated fields from my Table, leave them in the query, and turn the query with the calculated fields into the report.
Yes I need to pull a report based on what is in progress, what has been completed and what is overdue. I thought it would be easier if the status was determined automatically. Is there a better way? The other option was to have the user set the status manually. Again I am fairly new to Access...
Here is the resolution Josef P. Was able to provide. My issue, if I understand correctly is that I have a module that uses DiffDays to populate the Due Date field. I needed to connect that information in my query, which I had not done.
Sorry, there were several responses to My question. I was trying them all at different points. I am down to trying to work with two
#1 If I use the expression builder in the Query 1 I cannot get the Overdue to post correctly
Expr1: Switch([CompleteDate] Is Not Null,"Complete",[ReviewDate] Is...
I cannot Get the overdue to show correctly
Sorry I should have stated that the forms are not Done.
I am working with the Query 1 Query and the Query 1 Form. My bad.
When I get the statuses working correctly I was going to clean up. This is an excerpt of my read DB where I play to learn.
I am sorry guys. I am having a hard time. I can not figure out how to write simple Expressions. I have read and watched videos on If statements and if I understand correctly there is supposed to be an expression, a True, and a false. I Wrote this but get too many arguments...
I Tried to add a line
Public Function getResult(CompleteDate, ReviewDate, DueDate)
Select Case True
Case Not IsNull(CompleteDate)
getResult = "Complete"
Case IsNull(ReviewDate)
getResult = "Not Started"
Case DueDate > Date...
I have a glitch. The in-process date shows as Overdue. the Complete, Overdue, and Not Started statuses are working. The in in-process status is not working. It should show In process if the due date is greater than today.
Public Function getResult(CompleteDate, ReviewDate, DueDate)
Select Case...