Subform not allowing data entry

N

Nigel

Dear All

I have a control on my main form, Status. When it is set to "C" the subform
becomes not visible. When I change the status control to "A" the subform
becomes visible but I cannot enter any data. If I move away from this record
and then come back to it, I can then enter data into the subform. I would
like, obviously, to be able to enter data as soon as it becomes visible. Any
suggestions.

Thanks
 
D

Daryl S

Nigel -

What is the code behind the Status control? Are you setting the subform
properties there (e.g. making the subform visible or not)? Maybe you are
setting the DataEntry property to False and not setting it back to True?
Look at the code for the form's Current and Open events as well as the the
code for the Status control. Post the code if you need help analyzing it.
 
N

Nigel

Daryl

Following is the code used in the After Update event of the Status control
on the main form. You'll see that it also greys out other fields on the main
form:

Private Sub Status_AfterUpdate()
Dim ctrl As Control
If Status = "C" Then
For Each ctrl In Me.Controls
If ctrl.Tag = "Grey" Then
ctrl.Enabled = False
End If
Next
Else
For Each ctrl In Me.Controls
If ctrl.Tag = "Grey" Then
ctrl.Enabled = True
End If
Next
End If

If Me!Status = "C" Then
Me!frmOfstedReportSubForm.Visible = False
Else
Me!frmOfstedReportSubForm.Visible = True
End If
End Sub
 
D

Daryl S

Nigel -

You may want to add a Repaint to the code (right after
Me!frmOfstedReportSubForm.Visible = True).

Me!frmOfstedReportSubForm.Repaint
 
N

Nigel

Thank you. I haven't got access to the database now (no pum inteneded), but
I'll give it a try next week and let you know.

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