Last try PLease Help!!

D

Doug_C

Hello,

Ok, I will make this simple. I have a form that opens to a new record, say
this one is record #23. Once the information has been entered and the user
clicks AddRecord (now showing record #24) if the user goes back to record
#23, I want the Calculate button to be "Invisible". How do I do that? Please
simplify and if it is with VBA, please let me know which control and event to
enter it.

Thank you much!!!!
 
W

Wayne-I-M

Hi Doug

No worries - not too difficult. But can you let me know.
You have a form set to data entry
When you 1st open this form there is a button called Calculate that does
something (doesn't really matter what)

Do you want this button to be only visible is there is "no" data entered
into this recordset.

If this is the case do you still want the button to be visible when you open
(another) new record.

If I'm right about this let me know and I'll send the code.
 
S

SusanV

Assuming the button is called btnCalculate, use the On Current Event of the
form and show the button only if this is a new record:

Me.btnCalculate.visible = Me.NewRecord
 
D

Doug_C

Hi Wayne,

Yes, you are correct. I always want the button visible on a New Record and
only on an exisiting record, if the txtWorkdays field is blank.

Thanks!
 
D

Doug_C

Hi Susan,

This works great!! Except, I have an edit button that allows edit when a
password is entered. When I click on the edits button, I would like for the
cmdCalculate button to be visible. If you know how to do this last step, I
will be finished and ready to present.

Thanks!!!!
 
S

SusanV

Hi Doug,

In that case, you would use the OnClick of the button to reset the visible
property, something like

Me.btnCalculate.Visible = True

I haven't tested this against a "live" form, and the On Current *may*
over-ride this reset - let me know if it does.

SusanV
 
D

Doug_C

It worked!!!! I have been trying to do all kinds of workaround and finally
something worked. Thank you so much for your help, it is most
appreciated!!!!! This board has help me in many situations and I hope to
someday be able to help others on here.

Thanks again Susan!!!
 
S

SusanV

Two years ago when I was tasked with bringing a bunch of Excel files for
tracking a project into Access I had NO clue what I was doing, and VBA was
as mysterious to me as it would have been to the ancient Egyptians. Since
then I have learned an incredible amount, mainly by watching these forums,
and with the help of a few books by Ken Getz (Access 2000 desktop edition &
VBA Developers handbook). Stick around - learn all you can, and pass on what
you learn to others - it's a great feeling!

Happy coding!
;-)
SusanV
 
Top