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
..
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
..