auto add a value in form field

naobao

Registered User.
Local time
Yesterday, 23:59
Joined
Feb 13, 2014
Messages
99
I want to auto add a value in A FORM "PIC1" field "min qty" after update "item" field,
base on a TABLE information in "PIC2", please help how to do!
 

Attachments

  • PIC1.jpg
    PIC1.jpg
    53.2 KB · Views: 93
  • PIC2.jpg
    PIC2.jpg
    17.4 KB · Views: 87
Did you set the textbox DEFAULT VALUE?
It auto adds this value.
 
Change the Rowsource, Property of the ITEM control and write one line VBA code on AfterUpdate Event like this:

Change the ROWSOURCE of Item filed to Select ITEM_CODE, MIN_QTY FROM YourPic2Table ORDER BY ITEM_CODE.

Now go to the Format tab of Property Sheet and change the Column Count to 2 and next set Column Width = 1,0

Once you are done with the above steps now write the code on the VBE window under Control After Update Event.

Me.QTY = NZ(Me.Item.Column(1),0)
 

Users who are viewing this thread

Back
Top Bottom