auto add a value in form field (1 Viewer)

naobao

Registered User.
Local time
Today, 03:20
Joined
Feb 13, 2014
Messages
76
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: 51
  • PIC2.jpg
    PIC2.jpg
    17.4 KB · Views: 46

Ranman256

Well-known member
Local time
Today, 06:20
Joined
Apr 9, 2015
Messages
4,337
Did you set the textbox DEFAULT VALUE?
It auto adds this value.
 

almahmood

Registered User.
Local time
Today, 15:50
Joined
Mar 28, 2017
Messages
47
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

Top Bottom