conditional formating duplicates

steve111

Registered User.
Local time
Today, 21:47
Joined
Jan 30, 2014
Messages
429
hi ,


I have a form which will have many duplicate stock numbers in it , field called " stocknumber"

I also have a field called "qty reqd"

I want to apply a conditional format ( green background)to the "qty" field where the stocknumbers are the same

I tried [stocknumber]= [stocknumber] but did not work

any help appricated

steve
 
  1. Create a SELECT Query using the source table of the form.
  2. Use [StockNumber] Field Reference of the Form (Forms!FormName![StockNumber]) as Criteria in the Query column of StockNumber to filter the data in the query, based on the current record on the form.
  3. Add a Unbound Textbox on the Form Footer.
  4. Write the expression: =Dcount("*","MyQuery") and name the Textbox as DupStock.
  5. Use the expression =[DupStock]>1 in the criteria expression in the Conditional Formatting of "qty reqd" Field.

Write a one-line program on the Current Event of the Form as given below:

Sub Private Form_Current()
Me.Refresh
End Sub

This action will refresh the underlying Select Query with the current StockNumber on the Form.
 
I'm not sure how apr pillai managed to understand the OP but kudos to you ;)

I wonder what kind of view Steve has the form in? Single Form, Continuous or Datasheet?
 
hi ,

thanks for the reply but I was unable to do it do I have attached the form so you can see what I have and maybe help me from that


the form is called "requisition" with the subform "requisition items subform" you will see that lines 1 and 2 , 17 and 18 etc are pairs of parts

what I would like is all those pairs of parts highlighting yellow in the qty required field

thanks for your help
steve
 

Attachments

Last edited:
the form is called "requisition" with the subform "requisition items subform" you will see that lines 1 and 2 , 17 and 18 etc are pairs of parts

what I would like is all those pairs of parts highlighting yellow in the qty required field
There's no form called Requisition and it still isn't making any sense to me.
 
hi,

I have attached a new form

if you see line 1 and 2 the stock number is the same as is line 17 and 18 ( duplicate numbers) what I want to do is highlight all the duplicates

thanks
steve
 

Attachments

What exactly are the stock numbers steve111?
Lines 1 and 2 (i.e. 3573G1121) are the same but lines 17 (5060B3526M102) and 18 (5060B3584M101) are not the same.
 

Users who are viewing this thread

Back
Top Bottom