Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MouseUp Event - Error 2185 on Unbound Control

Status
Not open for further replies.

AKMonkeyboy

IS-IT--Management
Feb 4, 2002
141
US
Here's a puzzler:

I have the code:
Me.EndDate.SelStart = 0
Me.EndDate.SelLength = 10

Set to run in the MouseUp event of the control. The control is unbound... interestingly when there's data in the bound form the code works swimmingly... however, if there are no records in the underlying table I get an error 2185 stating I can't reference a property or control for a method unless it has the focus...

Anyone come across this and conquered it?

Monkey

Give a man a fish, and you feed him for a day.
Teach a man to fish, and you feed
him for life.
Send a man to Tek-Tips and the poor sap can find out how to fish on his own, and learn more by doing it.
 
How are ya AKMonkeyboy . . .

Program around it.
Code:
[blue]   If Not IsNull(Me.EndDate) then
      Me.EndDate.SelStart = 0
      Me.EndDate.SelLength = 10
   EndIf[/blue]


See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Doesn't quite do it...

If I have records available in the underlying table it works fine (always has), but if all the records are deleted I get the error, even with the "IsNull" statement.

Grrr....


A

Give a man a fish, and you feed him for a day.
Teach a man to fish, and you feed
him for life.
Send a man to Tek-Tips and the poor sap can find out how to fish on his own, and learn more by doing it.
 
Allan Browne has identified this as a Bug and he has a suggested workaround.
 
Thanks Golom... I'm reading the post and trying to see how it applies to my problem.

Research continues!

Give a man a fish, and you feed him for a day.
Teach a man to fish, and you feed
him for life.
Send a man to Tek-Tips and the poor sap can find out how to fish on his own, and learn more by doing it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top