Solved Trying to satisfy 2 conditions (1 Viewer)

Sam Summers

Registered User.
Local time
Today, 21:03
Joined
Sep 17, 2001
Messages
939
Hi Everyone,

I just cannot get my head round this one and the more i try the more confused i am!

I have to open a form to warn us to re-stock.
So i am setting it for the Form - On Load event and also when the remaining level goes below the reorder level.
So i need to create something like this:

If Me.Remaining.Value And Me.CurrentStock.Value >0 and <= Me.ReorderLevel.Value Then
DoCmd.OpenForm etc. etc.


Screenshot 2023-11-07 134009.png

Should be simple i know but i just can't see it!

Many thanks in advance
 

theDBguy

I’m here to help
Staff member
Local time
Today, 13:03
Joined
Oct 29, 2018
Messages
21,474
I think you need separate conditions like:

If Me.Remaining > 0 AND Me.CurrentStock <= Me.ReorderLevel Then

However, when would remaining and current stock have different values?
 

LarryE

Active member
Local time
Today, 13:03
Joined
Aug 18, 2021
Messages
592
Hi Everyone,

I just cannot get my head round this one and the more i try the more confused i am!

I have to open a form to warn us to re-stock.
So i am setting it for the Form - On Load event and also when the remaining level goes below the reorder level.
So i need to create something like this:

If Me.Remaining.Value And Me.CurrentStock.Value >0 and <= Me.ReorderLevel.Value Then
DoCmd.OpenForm etc. etc.


View attachment 110827
Should be simple i know but i just can't see it!

Many thanks in advance
Try:
If Me.Remaining >0 AND Me.Remaining<= Me.ReorderLevel OR Me.CurrentStock >0 AND Me.CurrentStock <= Me.ReorderLevel Then
 

Sam Summers

Registered User.
Local time
Today, 21:03
Joined
Sep 17, 2001
Messages
939
I think you need separate conditions like:

If Me.Remaining > 0 AND Me.CurrentStock <= Me.ReorderLevel Then

However, when would remaining and current stock have different values?
There was a reason why i created it that way but cant remember now it was to do with the numbers changing within the calculation - just remembered why. It was because the remaining value was not saving in the table on form close so created the CurrentStock field to do that.
There is probably a better way to do it than how i have.
 
Last edited:

Sam Summers

Registered User.
Local time
Today, 21:03
Joined
Sep 17, 2001
Messages
939
Try:
If Me.Remaining >0 AND Me.Remaining<= Me.ReorderLevel OR Me.CurrentStock >0 AND Me.CurrentStock <= Me.ReorderLevel Then
Looks like that has done it. I'll complete the testing and post here in a minute.
 

Sam Summers

Registered User.
Local time
Today, 21:03
Joined
Sep 17, 2001
Messages
939
Thanks guys. It is mainly sorted. Still having a bit of fun with the way it functions but your help has fixed that main issue.
This tiny little thing has been one of my worst nightmares to get right!
 

Users who are viewing this thread

Top Bottom