On Current update issue

T

TeeSee

I have a Mainform and a subform set to continuous form. The main form
holds a record of a Project. The sub form holds/displays three
companies involved in the "project"
On the main form I have two text boxes one wit ProjectID and one with
CompanyID. The strSQL uses them to create the correct recordset.
On opening the form the current event has the following code ....
Set db = CurrentDb()
Set rst = db.OpenRecordset(strSQL, dbOpenDynaset)
If rst.BOF And rst.EOF Then
Me.cmdViewData.ForeColor = vbBlack
Else
Me.cmdViewData.ForeColor = vbRed
End If
So for the first company on the subform (if there is a record in the
recordset) the ForeColor turns red. (As I intended)
When I now click on the second company name I can see the txtBox on
the main form change correctly but if there are no records in the
underlying table with the new combination of projectID and CompanyID I
can't seem to find the way to update the button foreColor.
If this makes sense could someone please help. Thanks
 

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