VB Question Reposted - Tony or if anyone else can help!!

S

SG

Tony,

I get the later with no message see code below...


Private Sub Quantity_AfterUpdate()
Dim intQtyMsg As Integer

If Onhand(Me.ProductID) < Me.Quantity Then intQtyMsg = MsgBox("You are
trying to sell more items than you currently have in stock, do you want to
continue?", vbYesNo)



If intQtyMsg = vbYes Then
Exit Sub
Else
Me.Quantity = 0

End If
End Sub


P.S Thank you for your help so far much appreciated!

S
 
R

ruralguy via AccessMonster.com

Do *not* put anything on the same line with "Then"

Private Sub Quantity_AfterUpdate()
Dim intQtyMsg As Integer

If Onhand(Me.ProductID) < Me.Quantity Then
intQtyMsg = MsgBox("You are trying to sell more items than you currently "
& _
"have in stock, do you want to continue?", vbYesNo)

If intQtyMsg = vbYes Then
Exit Sub
Else
Me.Quantity = 0
End If
End If

End Sub

Tony,

I get the later with no message see code below...

Private Sub Quantity_AfterUpdate()
Dim intQtyMsg As Integer

If Onhand(Me.ProductID) < Me.Quantity Then intQtyMsg = MsgBox("You are
trying to sell more items than you currently have in stock, do you want to
continue?", vbYesNo)

If intQtyMsg = vbYes Then
Exit Sub
Else
Me.Quantity = 0

End If
End Sub

P.S Thank you for your help so far much appreciated!

S

TonyT said:
Do you also get the message telling you, you are trying to sell more than
you
[quoted text clipped - 13 lines]
 
S

SG

Perfect! Thank you for the help, and Tony too!! :)

ruralguy via AccessMonster.com said:
Do *not* put anything on the same line with "Then"

Private Sub Quantity_AfterUpdate()
Dim intQtyMsg As Integer

If Onhand(Me.ProductID) < Me.Quantity Then
intQtyMsg = MsgBox("You are trying to sell more items than you currently
"
& _
"have in stock, do you want to continue?", vbYesNo)

If intQtyMsg = vbYes Then
Exit Sub
Else
Me.Quantity = 0
End If
End If

End Sub

Tony,

I get the later with no message see code below...

Private Sub Quantity_AfterUpdate()
Dim intQtyMsg As Integer

If Onhand(Me.ProductID) < Me.Quantity Then intQtyMsg = MsgBox("You are
trying to sell more items than you currently have in stock, do you want to
continue?", vbYesNo)

If intQtyMsg = vbYes Then
Exit Sub
Else
Me.Quantity = 0

End If
End Sub

P.S Thank you for your help so far much appreciated!

S

TonyT said:
Do you also get the message telling you, you are trying to sell more
than
you
[quoted text clipped - 13 lines]
not
allow me to add a quantity?
 
T

TonyT

no problem, glad you got it sorted,

TonyT..

SG said:
Perfect! Thank you for the help, and Tony too!! :)

ruralguy via AccessMonster.com said:
Do *not* put anything on the same line with "Then"

Private Sub Quantity_AfterUpdate()
Dim intQtyMsg As Integer

If Onhand(Me.ProductID) < Me.Quantity Then
intQtyMsg = MsgBox("You are trying to sell more items than you currently
"
& _
"have in stock, do you want to continue?", vbYesNo)

If intQtyMsg = vbYes Then
Exit Sub
Else
Me.Quantity = 0
End If
End If

End Sub

Tony,

I get the later with no message see code below...

Private Sub Quantity_AfterUpdate()
Dim intQtyMsg As Integer

If Onhand(Me.ProductID) < Me.Quantity Then intQtyMsg = MsgBox("You are
trying to sell more items than you currently have in stock, do you want to
continue?", vbYesNo)

If intQtyMsg = vbYes Then
Exit Sub
Else
Me.Quantity = 0

End If
End Sub

P.S Thank you for your help so far much appreciated!

S

Do you also get the message telling you, you are trying to sell more
than
you
[quoted text clipped - 13 lines]
not
allow me to add a quantity?
 

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

Similar Threads

Close Button Problem. 4
Rename Message Box 3
SendObject 0
MsgBox 9
Changes in How Code Acts After Upgrade of Excel 2
Limit to List question 11
NotInList Firing Problem 17
SendObject code 6

Top