Another access question

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:
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
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,221,798
Messages
6,162,025
Members
451,737
Latest member
MRASHLEY

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top