Object does not support property or methiod

D

dave

I am trying to hide a field on a form when it opens.

This is the code I am trying (but giving me the above error:

stDocName = "frmCareerProfile"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms!frmCareerProfile.txtSearchlastName.visable = False

how should I be coding this?

ALSO: How can I turn off navigation buttons for this form also (after Open)

Thanks,


dave
 
D

Dirk Goldgar

dave said:
I am trying to hide a field on a form when it opens.

This is the code I am trying (but giving me the above error:

stDocName = "frmCareerProfile"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms!frmCareerProfile.txtSearchlastName.visable = False

You've misspelled "Visible".
ALSO: How can I turn off navigation buttons for this form also (after
Open)

Have you tried

Forms!frmCareerProfile.NavigationButtons = False

?
 
A

Allen Browne

What is txtSearchlastName?
Is it an unbound text box in the Form Header section?
Does this error occur only when the form opens without any matches and so
the Detail section goes completely blank? If so, this is an Access bug.
Demonstration here:
http://allenbrowne.com/bug-06.html

If that is not the issue, does the code compile?
(Compile on Debug menu, in code window)

Which line gives the error?

What is stLinkCriteria?
Could this be invalid?

Is frmCareerProfile the form this code is in?
If so, this won't work in its open event, as it's already opening.

Is frmCareerProfile a subform?
If so, it's not open in its own right.

You can programmatically hide the navigation buttons like this:
Forms!frmCareerProvide.NavigationButtons = False
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top