Hi All,
I would like to be able to delete text from a field before printing, if a certain criteria is not met.
Here is the scenario:
1. Finished doing data entry on a form
2. I have a field named "DefaultInfo", that has default data, which is: "THIS SECTION NEEDS TO BE FILLED IN".
3. If the user does not change this field before he clicks the print button, I would like for that data to be erased automatically when he/she clicks the Print button. I don't want that data to show up in the report, if it is not changed.
This is the code I am using as of now, for print command button (OnClick Event):
Private Sub Prnt_Report_Click()
DoCmd.OpenReport "rpt_Report1", acViewPreview, , "[ID]=" & Forms![frm_Form1]![ID]
If DefaultInfo.Text = "THIS SECTION NEEDS TO BE FILLED IN" Then DefaultInfo.Text = ""
End Sub
It doesn't work, and I know I am missing something. I probably should have a requery command also, before the If statement, but I'm not sure.
Can someone help me with this, please
Jerome
I would like to be able to delete text from a field before printing, if a certain criteria is not met.
Here is the scenario:
1. Finished doing data entry on a form
2. I have a field named "DefaultInfo", that has default data, which is: "THIS SECTION NEEDS TO BE FILLED IN".
3. If the user does not change this field before he clicks the print button, I would like for that data to be erased automatically when he/she clicks the Print button. I don't want that data to show up in the report, if it is not changed.
This is the code I am using as of now, for print command button (OnClick Event):
Private Sub Prnt_Report_Click()
DoCmd.OpenReport "rpt_Report1", acViewPreview, , "[ID]=" & Forms![frm_Form1]![ID]
If DefaultInfo.Text = "THIS SECTION NEEDS TO BE FILLED IN" Then DefaultInfo.Text = ""
End Sub
It doesn't work, and I know I am missing something. I probably should have a requery command also, before the If statement, but I'm not sure.
Can someone help me with this, please
Jerome