Hi,
I got a table Stock where i do set a minimum for products.And from the invoice form i got a label. I would like this label to turn to red when the minimum is reached. How do i go about it
Regards
Hi,
I got a table Stock where i do set a minimum for products.And from the invoice form i got a label. I would like this label to turn to red when the minimum is reached. How do i go about it
Regards
I presume this is on a single form?
labels cannot be conditionally formatted so you would need use some vba code - which will only work on a single form
where you put this code depends on when you want it to fire - if when you open the form, use the form current event, if after a user has entered a value which takes it below the minimum then that control after update event - or perhaps bothCode:if myControl<someminimum then myLabel.Backcolor=vbRed
I did what you have said but its like the program does not recognize minimum.I guess that minimum has to be taken from the stock table.As you can see in the code
If Me.Texte15.Value < minimum ThenMe.Texte30.BackColor = vbRed
It does not get the set minimum of the product
End If
you guess right!
So how do i go about it then
you could perhaps bring it in with the stock record or use a dlookup, but without knowing your table structure and relationships and how your form is designed I've no idea whether that is feasible
There is a table stock(stockid,stockname,stockQuantite,minimum) and the table invoice(invoiceId,stockid,invoiceDate,quantiteSort i,total).Then i made up a form invoice with a small label that has to change color.hoz do i use the DLook
here is a link to dlookup - the expression will be the minimum value, the table will be stock, and the criteria will use the stockid
https://support.office.com/en-us/art...b-bed10dca5937