Full Version: Enable textbox=false after click a button
UtterAccess Forums > Microsoft® Access > Access Forms
deasyn
Hi...
I have a button for print a record. When I click and the report is print, I want that some text box enable=false.
How to make it? any idea? Please advice...
egards,
Deasy
JayNoelOlimpo
Hi;
On Click event of a button ...
txtBoxNameHere.Enabled = False
HTH.
deasyn
Already did that but nothing happens. Any idea?
Please advice...
egards,
Deasy
JayNoelOlimpo
Could you post the event triggered by the print button?
deasyn
Here the code that I create..
Is that right?
Private Sub BtnPrintRptFormBS_Click()
On Error GoTo Err_BtnPrintRptFormBS_Click
Dim stDocName As String
stDocName = "RptApprovalBS"
DoCmd.OpenReport stDocName, acNormal
Exit_BtnPrintRptFormBS_Click:
Exit Sub
Err_BtnPrintRptFormBS_Click:
MsgBox Err.Description
Resume Exit_BtnPrintRptFormBS_Click
ApprovalID.Enabled = False
Product.Enabled = False
End Sub
JayNoelOlimpo
You seem to have placed the enabled true/false if the print button failed.
Try placing it after the Docmd.OpenReport ...
HTW.
deasyn
Ya... you are right... thank you so much..................................
frown.gif
deasyn
but I want after I close the form and open it again, the text box become enable again. I want that after I print the report, The text box enable=false.
deasyn
but after I close the form and open it again, the text box become enable again.
I want that after I print the report, The text box enable=false, even I close the form.
R. Hicks
To do this .. you will need to add a yes/no field to the record in the table to designate when the report has been printed for the specific record ...
You will need to alter this field value as need to indicate the report's print status .. and use this value to enable or disable the control based on the stored value ...

RDH
JayNoelOlimpo
You have to have some sort of a field Yes/No field to determine if a record has been printed or not.
If a field is yes then those other fields would not be enabled.
deasyn
Oke I will Try then...
frown.gif
JayNoelOlimpo
Good Luck!
deasyn
I will tell you when I done. Thank you so much..............
frown.gif
deasyn
Sorry to ask again,,,,
How to code the table field? May I have the example? I'm beginner in access...
JayNoelOlimpo
Place it in the Form where the print button is located and simply place ...
ldPrinted = True under Docmd.OpenReport
replace fldPrinted as the name of your field ...
HTW.
deasyn
Oke... Thank you so much...
you are brilliant..
frown.gif
JayNoelOlimpo
Glad to help. thumbup.gif
GOOD LUCK!
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.