update sells price after (1 Viewer)

togur

New member
Local time
Today, 04:18
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: 78

Minty

AWF VIP
Local time
Today, 11:18
Joined
Jul 26, 2013
Messages
10,355
In the Current Event of the form, you would need to reset any unbound fields to Null.
 

togur

New member
Local time
Today, 04:18
Joined
Mar 26, 2021
Messages
5
How to reset to Null, please ?
The unbound filed is called " CmimShitje"
Can you tell me the code
thanks
 

theDBguy

I’m here to help
Staff member
Local time
Today, 04:18
Joined
Oct 29, 2018
Messages
21,358
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?
 

Minty

AWF VIP
Local time
Today, 11:18
Joined
Jul 26, 2013
Messages
10,355
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
 

togur

New member
Local time
Today, 04:18
Joined
Mar 26, 2021
Messages
5
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: 82
  • WhatsApp Image 2021-04-08 at 18.27.52.jpeg
    WhatsApp Image 2021-04-08 at 18.27.52.jpeg
    117.9 KB · Views: 92

theDBguy

I’m here to help
Staff member
Local time
Today, 04:18
Joined
Oct 29, 2018
Messages
21,358
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)
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 19:18
Joined
May 7, 2009
Messages
19,175
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

Top Bottom