Hello everyone -
I appreciate your attention to this question. I haven't done any real VB programming in decades, however our programmer has quit and I am the designated sucker until we hire someone new to the position.
I have inherited an Access db that, among other things allows our sales people to send letters to our customers. This behemoth is about as user friendly as a brick and I have been working to make it more self service for our sales people (hopefully I can get back to my regular duties). I have created a form with three text boxes. I would like the users to enter text in these three boxes and this to update text in the letters (report) they are going to be sending out. This will be using the Replace function, searching for a specific bit of text and replacing it with what is entered in the text box. However, my code is lacking. I have spent two days on this and every time I do a debug.print on whatever text I put in the text box, it shows up as null and therefore I can't pass that to the control in the report...even if I knew how to do it. I can store the letter text if I use three input boxes, but it would be much more user friendly to use textboxes. Maybe text can't be sent between forms and reports and this is all for naught. I'm sure I am referencing the controls wrong because on the line when I am referencing the report I am getting an error saying that the report doesn't exist when I am using the correct name. In VB I remember using .text or .value properties, the .controlsource has me befuddled.
I don't really have any code because nothing is working, but I can hash out something and hopefully someone can point me in the right direction.
Again, I apologize for the newbie question but if you could point me in the right direction, I would greatly appreciate it.
Sincerely
ChiTriGuy
I appreciate your attention to this question. I haven't done any real VB programming in decades, however our programmer has quit and I am the designated sucker until we hire someone new to the position.
I have inherited an Access db that, among other things allows our sales people to send letters to our customers. This behemoth is about as user friendly as a brick and I have been working to make it more self service for our sales people (hopefully I can get back to my regular duties). I have created a form with three text boxes. I would like the users to enter text in these three boxes and this to update text in the letters (report) they are going to be sending out. This will be using the Replace function, searching for a specific bit of text and replacing it with what is entered in the text box. However, my code is lacking. I have spent two days on this and every time I do a debug.print on whatever text I put in the text box, it shows up as null and therefore I can't pass that to the control in the report...even if I knew how to do it. I can store the letter text if I use three input boxes, but it would be much more user friendly to use textboxes. Maybe text can't be sent between forms and reports and this is all for naught. I'm sure I am referencing the controls wrong because on the line when I am referencing the report I am getting an error saying that the report doesn't exist when I am using the correct name. In VB I remember using .text or .value properties, the .controlsource has me befuddled.
I don't really have any code because nothing is working, but I can hash out something and hopefully someone can point me in the right direction.
Code:
Private Sub cmdUpdateLetters_Click()
'I'm only showing one text box for brevity
Dim strInput1stParagraph As String
strInput1stParagraph = Forms![Input Form]!txtFirstParagraph.ControlSource
Debug.Print "strInput1stParagraph = " & strInput1stParagraph 'Getting nothing
strOutput1stParagraph = Reports![Output Letters]!txtFirst.ControlSource
Debug.Print "strOutput1stParagraph = " & strOutput1stParagraph 'Getting nothing
Reports![Output Letters]!txtFirst.ControlSource = Replace(strOutput1stParagraph, _
"OutputFirstParagraphText", "=" & strInput1stParagraph & ":" & [NewDate])
End Sub
Again, I apologize for the newbie question but if you could point me in the right direction, I would greatly appreciate it.
Sincerely
ChiTriGuy