R
Ray Gibson
I am a Access VB newbie and need some basic help writing this code. What I
am trying to produce is an error message on a form before it updates if a
certain case exists.
ie. There is not enough QTY in Tbl_StudData. to fullfill your request.
Here's what I have so far:
Select Case Location
Case "Vault"
if (Select [Tbl_StudData].[Qty-Vault] from [Tbl_StudData] where Me.Sku
= [Tbl_StudData].sku)< Me.Qty.Value Then
Cancel = True
MsgBox "Not enough Qty."
Me.Qty.Value = Null
End If
Case "Memo"
if (Select [Tbl_StudData].[Qty-Memo] from [Tbl_StudData] where Me.Sku
= [Tbl_StudData].sku)< Me.Qty.Value Then
Cancel = True
MsgBox "Not enough Qty."
Me.Qty.Value = Null
End If
End Select
I get A Run Time Error '2465' each time I try to save the record. VB
highlights this line:if (Select [Tbl_StudData].[Qty-Vault] from
[Tbl_StudData] where Me.Sku = [Tbl_StudData].sku)< Me.Qty.Value Then
am trying to produce is an error message on a form before it updates if a
certain case exists.
ie. There is not enough QTY in Tbl_StudData. to fullfill your request.
Here's what I have so far:
Select Case Location
Case "Vault"
if (Select [Tbl_StudData].[Qty-Vault] from [Tbl_StudData] where Me.Sku
= [Tbl_StudData].sku)< Me.Qty.Value Then
Cancel = True
MsgBox "Not enough Qty."
Me.Qty.Value = Null
End If
Case "Memo"
if (Select [Tbl_StudData].[Qty-Memo] from [Tbl_StudData] where Me.Sku
= [Tbl_StudData].sku)< Me.Qty.Value Then
Cancel = True
MsgBox "Not enough Qty."
Me.Qty.Value = Null
End If
End Select
I get A Run Time Error '2465' each time I try to save the record. VB
highlights this line:if (Select [Tbl_StudData].[Qty-Vault] from
[Tbl_StudData] where Me.Sku = [Tbl_StudData].sku)< Me.Qty.Value Then