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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing caption on command button

Status
Not open for further replies.

emtenzer

MIS
Nov 14, 2001
50
0
0
US
I have a subform with a command button. I want the caption on the command button to change depending on the value in a text box. I have tried on current, on load, on open, etc... i get the same message - Method or data member not found.

My code is simple:
If Me.Status = 1 Then
Me.btnNewCourtesyCall.Caption = "Click here to make a Courtesy Call"
Else
Me.btnNewCourtesyCall.Caption = "No calls to make"
End If

Thanks in advance for any insight.
 
frmClient Information is the main form.
frmCallAudit is a subform on a page on that main form.

This is my exact code:

If Forms!frmClientInformation!frmCallAudit.Form.txtStatus = 1 Then

Forms!frmClientInformation!frmCallAudit.Form.btnNewCourtesyCall.Caption = "Click here to make a Courtesy Call"

Else

Forms!frmClientInformation!frmCallAudit.Form.btnNewCourtesyCall.Caption = "No calls to make"
End If
End Sub

 
Hi!

What is the name of the subform control on the main form? If it is the same as the name of the form in it, then you should probably change it.

Note again that the syntax calls for the name of the control, not the name of the subform. If these two things have the same name, Access might get confused.



Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
Thank you! I got it! Many thanks for your persistance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top