Caption change on form load

  • Thread starter Thread starter d9pierce
  • Start date Start date
D

d9pierce

Hi all,
I have a frm_ContactEdit that I enter from another form with
cmdButtons. The code for these buttons are for add, edit, and delete
(See Coed Below). I have a read only form to keep from editing, adding,
or deleting just n case :). I would like to use this one form but
change the lbl on the form from Frm_ContactEdit to Contact Add, Contact
Delete, and Contact Edit when I open this form using a cmdButton from
my other page. Does anyone have a code source for this?

Private Sub Add_New_Click()
DoCmd.OpenForm "Frm_EditContact", dataMode:=acFormAdd
End Sub

Private Sub Contact_Edit_Click()
DoCmd.OpenForm "Frm_EditContact", , , "ContactID=" &
Me.ContactLst.Column(0)
End Sub

I have not added the delete button yet but will soon.
Thanks,
Dave
 
Dave,
Private Sub Add_New_Click()
DoCmd.OpenForm "Frm_EditContact", dataMode:=acFormAdd
Forms!frm_EditContact.Caption = "Your Caption here"
Private Sub Contact_Edit_Click()
DoCmd.OpenForm "Frm_EditContact", , , "ContactID=" &
Me.ContactLst.Column(0)
Forms!frm_EditContact.Caption = "Your Other Caption here"
 

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

Back
Top