I am trying to make a user friendly interface where a lot of updating of reports occurs. I have a form where a user can choose a customer name (eg. John Doe), type in a date (eg. 1/1/2011), click the command button and what I want to happen is that a textbox in the report "John Doe" with update to "Effective: January 1, 2011. I am having trouble when I am trying to reference the text box in the report. Here is my code:
Dim Cname As String
Dim edate As Date
Me.Combo113.SetFocus
Cname = Me.Combo113.Text
Debug.Print Cname
Combo113 and text126 is on the form, combo selects the customer and text126 is where the date is inputed. text71 is the unbound textbox in the customer report. I am getting trouble as the red and is giving me the error "Compile error: Type-declaration character does not match declared data type"
Dim Cname As String
Dim edate As Date
Me.Combo113.SetFocus
Cname = Me.Combo113.Text
Debug.Print Cname
Code:
edate = Format(Me.Text126, "mmmm dd"", ""yyyy")
Debug.Print edate
Debug.Print Cname
DoCmd.OpenReport "" & Cname & "", acViewDesign
[COLOR=red]Reports![/COLOR][COLOR=black]("[/COLOR] & Cname & ").Text71.Value = "Effective: " & edate
DoCmd.Close acReport, "" & Cname & "", acSaveYes
Combo113 and text126 is on the form, combo selects the customer and text126 is where the date is inputed. text71 is the unbound textbox in the customer report. I am getting trouble as the red and is giving me the error "Compile error: Type-declaration character does not match declared data type"