ColinSully
Board Regular
- Joined
- May 9, 2002
- Messages
- 69
I hope I'm not starting to irritate anybody but I've aqcuired this database and am in way over my head when it comes to working with it. I have extensive experience in excel and VB, but am new to access.
I have this form that has a subform. The subform has information that displayes forecasted and actual values for each quarter for a project. The values for the quarters are stored in one table (ie. every projects records are in the table witht he ProjectID as a primary key).
Basically what I want to do is modify this code:
The code currently ensures that an actual value exists for the prior quarter before it allows you to input it in the next one. I want to continue to do this but also disable and/or lock entry into all but the last entry available. So when someone enters data into the new quarter they can no longer enter into the previous one.
If someone can let me know if this is possible without expending a lot of time it would be helpful.
You people are great.
Many thanks,
Colin
I have this form that has a subform. The subform has information that displayes forecasted and actual values for each quarter for a project. The values for the quarters are stored in one table (ie. every projects records are in the table witht he ProjectID as a primary key).
Basically what I want to do is modify this code:
Code:
Private Sub txtActualCanadianCost_AfterUpdate()
If IsNull(txtActualCanadianCost) = False Then
'Makes sure that there have been actual values intered into the previus quarters
If IsNull(DLookup("ActualCanadianCost", "Record", "Record.ProjectID=Forms![ProjectRecords]![lstSelectaProject] and Record.Quarter = Forms![ProjectRecords]![Recordsubform].Form![Quarter] - 1")) = True And lstQuarter <> 1 Then
MsgBox "You need to enter a value in a previous quarter"
txtActualCanadianCost = Null
Else
txtForecastedCanadianCost = Null 'Deletes the corresponding Forecast for that quarter
End If
End If
End Sub
The code currently ensures that an actual value exists for the prior quarter before it allows you to input it in the next one. I want to continue to do this but also disable and/or lock entry into all but the last entry available. So when someone enters data into the new quarter they can no longer enter into the previous one.
If someone can let me know if this is possible without expending a lot of time it would be helpful.
You people are great.
Many thanks,
Colin