97 to 2000 problem

J

J M Ray

I posted this in the other forum, but was told this one
might be more appropriate. I have tried it on 3 machines
with Access 2000 without success.

I have an application which was developed in Access 97.
We are now switching to Access 2000. My problem is with
an event that doesn't work in 2000. The strange part is
that it does work in 97 and 2003. Basically I have a
unbound control in the form header which I use to filter
for a record to be edited. The code is below. When run
under 2000, if the record is found it drops down to the
next field [CurrentInvoice] but it doesn't display the
record. If the record doesn't exist it displays the error
message. When run under 97 or 2003 it pulls up the
appropriate record for editing. Any ideas what is wrong?
Thanks in advance, JMR

Private Sub SelInvoice_AfterUpdate()
Dim varX As Long

varX = Me![SelInvoice]

If varX = DLookup("[Invoice
#]", "tblInvoice", "[invoice #]=" & Forms!
[frmInvoiceEdit]![SelInvoice]) Then
DoCmd.ApplyFilter , "[Invoice #]=Forms!
[frmInvoiceEdit]![SelInvoice]"
Me![CurrentInvoice].Enabled = True
Me![CurrentInvoice].SetFocus
Else
MsgBox "That Invoice does not exist",
vbOKOnly, "Invoice not found"
[SelInvoice].SetFocus
[SelInvoice] = Null
End If
End Sub

..
 
D

david epsom dot com dot au

1) filter works for us in A2K

2) Make sure that you are fully patched
for both Office (SR3) and Jet (Sp7 or 8)

3) C'mon: you have a field called 'Invoice #'
with both a space and a hash mark? Try it with
a reasonable field name.


(david)
 
G

Guest

Thanks for the response David. Though the Win 2k machines
are fully patched, it still doesn't work. Seems strange
that it does under Access 2003. Sorry to have offended
you with the field name, however in this context it
violates no formal rules. Were I to rewrite this app, I
would have it conform to current standards, but until
management agrees to pay for this I shall work with what
I have. The application has worked flawlessly for many
years now.. it only breaks under 2K, I am looking for a
reason as to why.

JMR
 
D

david epsom dot com dot au

I have no problem with code like yours in A2K.

(although I have not tried with your field name).
Check again your Office Patch level, try rebuilding
the mdb, check your data, step through the code
etc.

(david)
 

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