disable certain controls

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I Have a form named "Suppliers" when I click on a product in the suppliers
Subform it opens a form called products listing that particular product. I
use this form also to enter products.
Question: When I click on a product from the suppliers subform I would like
to disable my "Add & Delete Product controls" only in this particular
scenario.
Thanks in advance
Alvin
 
Alvin said:
I Have a form named "Suppliers" when I click on a product in the suppliers
Subform it opens a form called products listing that particular product. I
use this form also to enter products.
Question: When I click on a product from the suppliers subform I would like
to disable my "Add & Delete Product controls" only in this particular
scenario.
Thanks in advance
Alvin

In the function which is opening the products listing, you need to add
additional commands to disable the controls you want.

txtYourTextBox.Enabled = False
cmdYourCommandButton.Enabled = False

etc. etc.

Make sure that you set them *back* to enabled however, for the other
scenarios. Possibly in the closing event of the product popup form, or
in the current event of the Suppliers form.
 
The following is my code and it is opening the form normally;
Not sure but I know it is a simple fix.
Thank you for the reply.
Alvin
########## Code ##########
Private Sub ProductName_Click()
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Add Invoicing Product"

stLinkCriteria = "[ProductID]=" & Me![ProductID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Combo49.Visible = False
Command18.Enabled = False
End Sub
##### End Code #####
 
Back
Top