Make Button Visible

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

Guest

Hello,

I am having issues with some buttons on my form.

I have a field called "txtWorkdays" which calculates the number of work days
between the date in and date out fields when the cmdCalculate button is
clicked. Once the txtWorkdays field has a number in the field, how to I
disable the calculate button so that when a user goes back to a previous
record it is still disabled unless the manager clicks the edit button on the
bottom of the form after putting in a password? After the new record button
has been pressed, I have the form set up for read only when a record goes
back to a previous record. Everything locks button the command button.

Can this be done? Please simplify answers as I am still a novice and not to
swift with VBA but always trying to learn.

Thanks!!!!
 
Command buttons have an Enabled property that you can set with code:

'disable the button
Me.cmdCalculate.Enabled = False

'enable it again
Me.cmdCalculate.Enabled = True

Put this where it makes sense in your code.

Barry
 
Back
Top