Textbox ReadOnly

  • Thread starter Thread starter ym
  • Start date Start date
Y

ym

Hello,

Rick B, if you are reading this ...I have yet to return to work on my
TabIndex problem.... will do so after finishing this to-be-done first item..

I have to modify a continuous form which recordsource tahat is bound to a
table "tbl_ReceviedReports" and it has only 4 fields "Date Received", "Total
Received", "Follow Up", "Backlog" and these are the 4 textboxes in the form.

User will enter a "Date Received" .

There is a GotFocus event in "Total Received" and the code :

Private Sub Total_Received.Text _GotFocus()
Total_Received.Text .SetFocus
Total_Received.Text = DCount("[Reports]![Tracking Number]", "Reports",
"[Reports]![DateReceived]=[DateReceived]")
End Sub

- this counts and displays the number of reports they received for the Date
entered. However, the user can overwrite this number and this is no good -
I have modify this textbox to make it readonly.

I tried setting the "Total Received" Locked = yes and use a "Date Received"
AfterUpdate event to execute the
Total_Received.Text .SetFocus
Total_Received.Text = DCount("[Reports]![Tracking Number]", "Reports",
"[Reports]![DateReceived]=[DateReceived]")
but this failed - I supposed it can't setfocus on a control that is Locked.

Would appreciate any help on how I can make this textbox readonly. Thank
you in advance.
 
Hi,

Try setting the control source property to:

= DCount("[Reports]![Tracking Number]", "Reports",
"[Reports]![DateReceived]=[DateReceived]")

The .Text bit looks wrong to me. Are your text boxes named with full stops?

If so I would recommend removing the fullstops.

HTH

Mark
 
Back
Top