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 / June 2007

Tip: Looking for answers? Try searching our database.

Property not found error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
swas - 04 Jun 2007 13:15 GMT
Hi,
I have a subform to be viewed in both datasheet and form view.

When the form is viewed in form view, no problems. When viewed in datasheet
view the following code generates a 'Property not found' error. The offending
line of code is 'CheckMDBF = False' in the function (Well at least if the
line of code is removed, the error stops).

The function is used in a couple of BeforeUpdate events, with the same
error, and only in DS view.

I don't understand why. Can anyone help?

Thanks

swas

Private Sub MDBF_BeforeUpdate(Cancel As Integer)

If Not CheckMDBF Then
   'Setting to low, warned in CheckMDBF
   
   Cancel = True
   
   MDBF.Undo

End If

End Sub

Private Function CheckMDBF() As Boolean
'Checks MDBF and fill freq settings are ok

CheckMDBF = True

If FillFrequency > 0 Then
   
   If MDBF < (FillFrequency * 7) + 1 Then
       'MDBF will kick fill in before preschedule will
       MsgBox "For '" & FillFrequency.Column(1) & "' Pre Schedule setting,
Max Days Between Fills must be > " & _
           FillFrequency * 7 & " days.", vbOKOnly, "Max Days Between Fills
Low"
   
       CheckMDBF = False '*** This line of code causes error in datasheet
view
       
   End If
   
End If

End Function
swas - 06 Jun 2007 12:33 GMT
I'm not sure why also, but even with error trapping in place in the 'property
not found' error still comes up.

I have rebuilt the entire form with no luck.

The only other unusual thing is I get 'no current record' error instead of
'property not found'. Yet there definitely is a current record...

Can anyone at least offer a direction to solve?

Thanks

swas

> Hi,
> I have a subform to be viewed in both datasheet and form view.
[quoted text clipped - 48 lines]
>
> End Function
BruceM - 06 Jun 2007 15:14 GMT
Have you compiled the code?  Do you have error handling that shows what
event is producing the error?  I know you said that if a line of code in
CheckMDBF is removed, the error stops, so I assume the error is in the
CheckMDBF function, but I don't know that for sure.  In any case, it would
help knowing what line is generating the "Property not found" error.  I
notice that you do not use the Me.MDBF.Undo syntax (you leave out the Me).
It may be worth trying the Me syntax.  Also, if MDBF is both a control and a
field, Access could be getting confused when it tries to apply Undo to a
field rather than a control.  Access contributes to this problem by using
the field name as the default control name for a text box, so it is up to
you to rename such text boxes.

What is MDBF?  I assume it is a bound control such as combo box.  Have you
tried changing:
If Not CheckMDBF Then
to
If CheckMDBF = False

Remember that we cannot see your database, and are not familiar with the
real-world situation you are trying to address.  At a guess I would say this
has something to do with refilling fuel tanks, but even if that is true,
there is no way of knowing if MDBF is a field or a control, or what you mean
by  "'MDBF will kick fill in before preschedule will".  I am taking a stab
at the question because it has not received other responses after a couple
of days.  My comments and suggestions of things to try are just things I
noted.  I could not say why datasheet view specifically is causing problems.

In your follow-up post you say that the error message has changed.  Do you
mean that the circumstances that produced "Property not found" now produce
"No current record"?

Have you tried Compact and Repair?  If no luck there, you may as well export
everything to a new, blank database.  It may be worth turning off Name
Auto-Correct when you do.  This link has more information about that:
http://allenbrowne.com/bug-03.html

> I'm not sure why also, but even with error trapping in place in the
> 'property
[quoted text clipped - 68 lines]
>>
>> End Function
swas - 11 Jun 2007 07:18 GMT
BruceM,

Thanks for the detailed response.

I had tried the majority of your suggestions with no luck prior to posting.

MDBF is a field and control, and I hadn't tried renaming the text box - this
sounds like a possibility. I solved the problem by shifting the checking into
the form beforeupdate, so CheckMDBF only needs using once within this routine
(Rather than a function).

For what it is worth, it is tracking stocking. FillFrequency is prescheduled
stocks, with Max Days Between Fills an overriding maximum setting.

Thanks again.

swas

> Have you compiled the code?  Do you have error handling that shows what
> event is producing the error?  I know you said that if a line of code in
[quoted text clipped - 104 lines]
> >>
> >> End Function
 
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.