update sells price after

togur

New member
Local time
Today, 01:10
Joined
Mar 26, 2021
Messages
5
I have a Combo-box in a form with 2 Columns - ProduktName and sellprice
I used a code :
Private Sub ProduktName_AfterUpdate()
sellsprise = ProduktName.Column(2)

The problem is:
When i lselected the produktname , is coming correct the sellprice,
after geting the new record the last price is seeing - (200)
when the new produkt name is selcted is coming the new sellsprice
I want to be empty the sell price before i am geting the new produkt name
See the foto please
 

Attachments

  • WhatsApp Image 2021-04-08 at 17.41.05.jpeg
    WhatsApp Image 2021-04-08 at 17.41.05.jpeg
    138.1 KB · Views: 115
In the Current Event of the form, you would need to reset any unbound fields to Null.
 
How to reset to Null, please ?
The unbound filed is called " CmimShitje"
Can you tell me the code
thanks
 
How to reset to Null, please ?
The unbound filed is called " CmimShitje"
Can you tell me the code
thanks
Hi. Welcome to AWF!

Can you please confirm if CmimShitje is bound or unbound? What is in its Control Source property?
 
Assuming CminShitje is Unbound - In the Forms Current Event something like

Code:
If IsNull(Me.ProduktName) Then
   Me.CminShitje = Null
Else
   Me.CminShitje = Me.ProduktName.Column(2)
End If
 
Hi. Welcome to AWF!

Can you please confirm if CmimShitje is bound or unbound? What is in its Control Source property?
The box "CmimShitje" is unbound!
see the foto please
 

Attachments

  • WhatsApp Image 2021-04-08 at 18.28.02.jpeg
    WhatsApp Image 2021-04-08 at 18.28.02.jpeg
    124.8 KB · Views: 120
  • WhatsApp Image 2021-04-08 at 18.27.52.jpeg
    WhatsApp Image 2021-04-08 at 18.27.52.jpeg
    117.9 KB · Views: 130
The box "CmimShitje" is unbound!
see the foto please
In that case, you could try putting this in its Control Source property.

Code:
=[ProduktName].[Column](2)
 
also see the Form's Before/After Update event if
there is code Setting the [Price]'s Default Value.
 

Users who are viewing this thread

Back
Top Bottom