Text Box in form to update report label Caption

bstice

Registered User.
Local time
Today, 00:07
Joined
Jul 16, 2008
Messages
55
Good evening all,

I have a text box in a form, in which users enter updates. I would like that text to become the caption on a label in a printable report. How would I write the VBA to do this? Thanks in advance for your help.

B
 
This is what I have tried so far...

Private Sub Command22_Click()
Dim BMM As String
BMM = Me.BMText.Value
DoCmd.OpenReport "BioMedRoundingReport"
Reports("BioMedRoundingReport")("BMLbl").Caption = BMM

DoCmd.Close "BioMedRoundingReport"
End Sub
 
I figured it out. Here you go.

Private Sub Command22_Click()
Dim BMM As String
Dim myReportName As String
BMM = Me.BMText.Value
myReportName = "BioMedRoundingReport"
DoCmd.OpenReport myReportName, acViewDesign
DoCmd.OpenReport myReportName, acViewDesign
With Reports(myReportName)
.BMLbl.Caption = BMM
End With
DoCmd.Save , myReportName
DoCmd.Close acReport, myReportName

End Sub
 

Users who are viewing this thread

Back
Top Bottom