new customer or supplier is not shown in Combo (1 Viewer)

hfsitumo2001

Member
Local time
Today, 03:24
Joined
Jan 17, 2021
Messages
365
Hello in my supplies issuance form, there is a button to add for new customer or supplier. when I add it, it will not be shown on the combo box, until we close the form and open it. What event procedure shall I make on the combo in order to automatically showing the new added supplier, just if I click the arrow of the combo.

Attached is the form to easily understand my problem.

Thank you.

Frank
 

Attachments

  • utofindnewaddition.jpg
    utofindnewaddition.jpg
    250.2 KB · Views: 385

theDBguy

I’m here to help
Staff member
Local time
Today, 03:24
Joined
Oct 29, 2018
Messages
21,357
Try adding something like:

Me.Combobox.Requery
 

hfsitumo2001

Member
Local time
Today, 03:24
Joined
Jan 17, 2021
Messages
365
I do not know the VBA for requery. Did you mean we click the arrow of the combo?. I did it but It still didn't show the new customer

Thanks for your enlightening me.

Frank
 

Gasman

Enthusiastic Amateur
Local time
Today, 10:24
Joined
Sep 21, 2011
Messages
14,038
I do not know the VBA for requery. Did you mean we click the arrow of the combo?. I did it but It still didn't show the new customer

Thanks for your enlightening me.

Frank
No, you refresh the source of the combo.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 05:24
Joined
Feb 28, 2001
Messages
26,996
If you add a customer, then as part of the code that adds the customer, do a Me.comboname.Requery - for EACH potentially affected combo or list box. OR you could just do a Me.Requery of the whole form. That forces re-evaluation of the recordsets.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:24
Joined
Oct 29, 2018
Messages
21,357
Sorry George, I did receive it. But in which event should I put :
Me.Combobox.Requery

Is it on click on the combo?

Thaks
You would use the event that fires after the user is finished adding the new information, and you're about to use it in the combo. You can certainly try using the GotFocus event of the combo, but if you are using the NotInList event, that might mean the combo never loses focus.
 

hfsitumo2001

Member
Local time
Today, 03:24
Joined
Jan 17, 2021
Messages
365
You would use the event that fires after the user is finished adding the new information, and you're about to use it in the combo. You can certainly try using the GotFocus event of the combo, but if you are using the NotInList event, that might mean the combo never loses focus.
Thank you very much George, I will try it
 

hfsitumo2001

Member
Local time
Today, 03:24
Joined
Jan 17, 2021
Messages
365
You would use the event that fires after the user is finished adding the new information, and you're about to use it in the combo. You can certainly try using the GotFocus event of the combo, but if you are using the NotInList event, that might mean the combo never loses focus.
Thank you George, you are awesome. You helped me a lot, even when I was in Indonesia, now I am in California you still help me. Thank you and God bless you.

Frank
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:24
Joined
Oct 29, 2018
Messages
21,357
Thank you George, you are awesome. You helped me a lot, even when I was in Indonesia, now I am in California you still help me. Thank you and God bless you.

Frank
Hi Frank. You're very welcome. And sorry, my name is not George. It's Leo. :)
 

Users who are viewing this thread

Top Bottom