PDA

View Full Version : Run Time error '2565' on click event to make combo box invisible - any suggestions?



wedd
09-21-2011, 04:46 AM
I have a run Time error '2465' after on an click event button. The fields are in the tables but I'm not sure why a message will display that microsoft access cannot find the field names. Have you any reasonable ideas why this is happening and what is a good solution to resolve this? What I'm tyring to achieve is when the button is clicked the mentioned listboxes and textboxes are invisible momentarily and a textbox appears in blue titled new customer. I'm a bit of a novice in vba...so suggestions by experts are more than welcome. Can this be achieved? If so, how? I have code listed below; reasonable suggestions are more than welcolme to achieve this or even solutions on websites to?



Private Sub Command51_Click()
If Me![Customer Name Box].Visible = False Then
Me![Customer Name Box].Visible = False
Me![Customer Name List].Visible = True

Else
Me![Customer Name Box].Visible = True
Me![Customer Name Box].Visible = False
End If
If Me![City Box].Visible = True Then
Me![City Box].Visible = False
Me![City List].Visible = True

Else
Me![City Box].Visible = True
Me![City Box].Visible = False
End If
If Me![Postal Code Box].Visible = True Then
Me![Postal Code Box].Visible = False
Me![Postal Code List].Visible = True

Else
Me![Postal Code Box].Visible = True
Me![Postal Code Box].Visible = False
End If
End Sub


Thanks for your suggestions:friends:

hansup
09-21-2011, 09:23 AM
Which line of code triggers the error?

What is the text of the error message?

Which error number, 2465 or 2565?