Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / January 2005

Tip: Looking for answers? Try searching our database.

Senseless error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark A. Sam - 28 Jan 2005 15:17 GMT
I have this code in the Change event of a combobox:

Private Sub Location_Change()
'On Error Resume Next

If [Location].Text = "" Then
 [Location] = "All"
End If

End Sub

It gives me err 2185

"You can't reference a property or method for a control unless the control
has the focus."

Obviously the contol has the focus since I changed its value and nothing
else changes the focus from this control.

I use this exact method in another app and it works fine.

Any ideas on this?

Thank you and God Bless,

Mark A. Sam
Allen Browne - 28 Jan 2005 15:37 GMT
If a form has no record and no new record can be added, the Detail section
goes completely blank, but the controls in the Form Header and Form Footer
sections are still visible. When this happens, Access has a bug that causes
it to get throughly confused about how to display values and what has focus.

Is that the case you are seeing? More info in:
   Incorrect display of data
at:
   http://members.iinet.net.au/~allenbrowne/bug-06.html

If that's not the issue, is there any more info you can give?

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

>I have this code in the Change event of a combobox:
>
[quoted text clipped - 22 lines]
>
> Mark A. Sam
Mark A. Sam - 29 Jan 2005 11:53 GMT
Hello Allen,

The form has a recordset, I was running the AfterUpdate event from the
OnChange which ran an OnClick of a button.  I moved the AfterUpdate code to
the OnChange which solved it.

Thanks for the feedback.  I helped me figure out the problem even though it
wasn't the solution.

God Bless you brother.

Mark

> If a form has no record and no new record can be added, the Detail section
> goes completely blank, but the controls in the Form Header and Form Footer
[quoted text clipped - 7 lines]
>
> If that's not the issue, is there any more info you can give?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.