how do i make a changed label caption stick

M

Macka

Hi I want to change a label caption and have the form display the new value
next time it is opened. tks Glen
 
J

Jack Leach

You can either set the label on open every time...

Private Sub Form_Open(Cancel As Integer)
Me.LabelName.Caption = "SomeCaption"
End Sub


or if you want you can create a function that opens the form in design mode,
changes the label, saves the form, and closes it...

Public Function SetCaption(strFormName As String, _
strLabelName As String, _
strCaption As String)
DoCmd.OpenForm strFormName, acDesign, , , acHidden
Forms(strFormName).Controls(strLabelName).Caption = strCaption
DoCmd.Close acForm, strFormName, acSaveYes
End Function

hth
--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
 

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