![]() |
|
|
Welcome to the { mindfrost82.com } forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
IIf Statement
I have a form called frmBrochures. Within this form, I have 3 fields -
product, max qty and order qty. Product is a drop down (from a table). When you select the product, the max qty populates. How do I set an alert if the order qty exceeds the max qty amount? Example - Product Max Order Paper 10 20 After keying in 20, I would want a alert that the qty is over the max. |
|
|||
|
RE: IIf Statement
You could let the user know there is a problem. You have not said if you
will allow the ordering of larger quanities than you have in stock - there may be a delivery in the morning so you take the order - If not you can always set the code to delete the quantity amount until it is equall to or lower the the Max - up to you Open the form in design view and right click the OrderQnty control Open the properties box In the evet column select the AfterUpdate row Click the build option (...) Select Code Put this (change the names of the controls to what you really use) Private Sub OrderQnty_AfterUpdate() If Me.OrderQnty > Me.MaxQnty Then MsgBox "Put some message here", vbQuestion, "There is a problem" End If End Sub Good luck -- Wayne Manchester, England. "Pass-the-reality" wrote: > I have a form called frmBrochures. Within this form, I have 3 fields - > product, max qty and order qty. Product is a drop down (from a table). When > you select the product, the max qty populates. How do I set an alert if the > order qty exceeds the max qty amount? Example - > > Product Max Order > Paper 10 20 > > After keying in 20, I would want a alert that the qty is over the max. |
|
|||
|
RE: IIf Statement
in the afterupdate event of the order control put:
If me.order>me.max then MsgBox ("You have exceeded the maximum available.") me.order=0 end if -- NTC "Pass-the-reality" wrote: > I have a form called frmBrochures. Within this form, I have 3 fields - > product, max qty and order qty. Product is a drop down (from a table). When > you select the product, the max qty populates. How do I set an alert if the > order qty exceeds the max qty amount? Example - > > Product Max Order > Paper 10 20 > > After keying in 20, I would want a alert that the qty is over the max. |
![]() |
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|