J
Jim Brooks
Please can someone help me with run time error I am getting when I try to use
a DMax function on a LineID control in a subform. I have a main form
frmDeliveries and a subform sfrmDeliveryDetails They are linked on master
and child by a DeliveryID control. On the sfrmDeliveryDetails BeforeUpdate I
entered :
Private Sub Form_BeforeInsert(Cancel As Integer)
Me![LineID] = Nz(DMax("[LineID]", "[sfrmDeliveryDetails]"), 0) + 1
End Sub (which I modified from a previous posting)
When I try to enter a selection from a Productscombo on the
sfrmDeliveriesDetails I get a Run Time error ‘3078’ which says Microsoft Jet
Database cannot find the input table or query sfrmDeliveryDetails. Make sure
it exists and that the name is spelled correctly.
If I remove the Dmax sub then everything works correctly. Have I put the sub
in the correct place and is the syntax correct in the line Me![LineID] =
Nz(DMax("[LineID]", "[sfrmDeliveryDetails]"), 0) + 1 Can someone please
head me in the right direction as I am still learning my way round VBA in
Access.
Thanks in advance Jim Brooks
a DMax function on a LineID control in a subform. I have a main form
frmDeliveries and a subform sfrmDeliveryDetails They are linked on master
and child by a DeliveryID control. On the sfrmDeliveryDetails BeforeUpdate I
entered :
Private Sub Form_BeforeInsert(Cancel As Integer)
Me![LineID] = Nz(DMax("[LineID]", "[sfrmDeliveryDetails]"), 0) + 1
End Sub (which I modified from a previous posting)
When I try to enter a selection from a Productscombo on the
sfrmDeliveriesDetails I get a Run Time error ‘3078’ which says Microsoft Jet
Database cannot find the input table or query sfrmDeliveryDetails. Make sure
it exists and that the name is spelled correctly.
If I remove the Dmax sub then everything works correctly. Have I put the sub
in the correct place and is the syntax correct in the line Me![LineID] =
Nz(DMax("[LineID]", "[sfrmDeliveryDetails]"), 0) + 1 Can someone please
head me in the right direction as I am still learning my way round VBA in
Access.
Thanks in advance Jim Brooks