Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Yes and No buttons to a Read Only subform

Status
Not open for further replies.

5tr0ud

Programmer
Aug 9, 2004
29
US
I've created a subform-6 (read only) which summarizes 5 other subforms. This is what the users wanted. It's working very well, but one user now wants to add a field to this (read only) subform, in which she can indicate Yes / No. However, she cannot directly enter data in the field.

I've created a field in the immediately preceding subform-5 that will update to Yes/ No through VBS code behind 2 buttons on subform-6. This is done by the user clicking either a Yes or a No button on the (read only) subform-6. This will then update the field in subform-5, and also SHOULD put that value in one of the (read only) subform-6 fields. To refresh subform-6, the user can then click a Refresh button on subform-6, which refreshes all data. This Refresh button has worked very well until this new addition.

PROBLEM: The Refresh button does not IMMEDIATELY update this new yes/no field on subform-6. The only way I can get the field to fill on subform-6 is to (1) click the immediately preceding subform-5, click back to subform-6, and click the Refresh button.

Is there any code to simplify this?

Thank you.
 
Hallo,

A Read-Only form Only allowing you to Read. Whatever next :)

Why not put code to update the underlying recordsource of subform 6 on the yes/no button on subform 6? No need to use subform 5.

Docmd.RunSQL "UPDATE tblData SET ysnQuestion=True WHERE lngId=" & Me!lngId
Me.Refresh

Something like that?

- Frink
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top