473,387 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ComboBox Refresh from PopupForm Revisited

COMBOBOX REFRESH DILEMMA

' I have been working for hours trying to figure out how to requery a
combobox in a subform, from a Popup form
' that this subform had launched. Basically, I designed a form that
pops up when the user dbl-clicks a combobox.
' This popup form displays the table that the combobox uses. The user
can change the content, and the combobox
' rowsource in-turn will change. This all works great in my mainform,
but not in a subform located on the main form.
' In a previous post, I was given some suggestions but could not
understand or get any of them to work, and was hoping
' for more advice, as I'm going crazy with this!!!

' ************************************************** **
' Mainform is [F-PERS], SubForm is [F-CRED], SubForm Control is [F-
CREDsub]
' The SubForm is located on a Tab of the MainForm and gets its
RecordSource in code when tabbed.
' My SubForm has 5-ComboBoxes, one of which is called cboStatus
' My PopUp Form is [FL-FIELDEDIT2] and is PopUp=Yes, Modal=Yes
' My Table for cboStatus is [T-STATUS] and the PopupForm uses this
Table for combo rowsource changes.

' The following code launches the popup form, from my SubForm :
' This popup I use for any combobox rowsource data change.
'----------------------------------------------------------------------
DoCmd.OpenForm "FL-FIELDEDIT2", acNormal, , , acFormEdit 'How I
call the PopUp
'I pass values to the Popup at this point, and this works OK.
[Forms]("FL-FIELDEDIT2").RecordSource = strTable
[Forms]("FL-FIELDEDIT2").lblSubject.Caption = strTitle
[Forms]("FL-FIELDEDIT2").txtDmyFormName = strFormName
[Forms]("FL-FIELDEDIT2").txtDmyCtrlName = strCtrlName
'----------------------------------------------------------------------

' Everything in the PopUp Form works great, I can change any
comboboxes rowsource from any form and for
' any combocontrol. BUT, I cannot Requery the combobox that launched
the PopUp Form!
' I cannot use the exit event of the combobox to requery (this is too
soon), and I cannot refer to the subform from
' the PopUp Form. Also, the SubForms AfterUpdate event is no good
because I'm still on the same record when
' the PopUp ends. The ComboBox needs to Refresh right after the PopUp
form exits.

' I'm so close except for this issue! Maybe My Approach Is
Wrong???

Thanks For The Patience
Greg

Feb 13 '07 #1
3 4250
This might seem basic and unconventional? Would this create any
problems, or suffer any performance hits with a large recordsource?

Private Sub cboSTATUS_GotFocus()
Me.cboSTATUS.Requery
End Sub

Thanks
Greg

Feb 14 '07 #2
On Feb 13, 8:03 pm, "ApexD...@gmail.com" <ApexD...@gmail.comwrote:
This might seem basic and unconventional? Would this create any
problems, or suffer any performance hits with a large recordsource?

Private Sub cboSTATUS_GotFocus()
Me.cboSTATUS.Requery
End Sub

Thanks
Greg
Using this event would requery very often and you may notice it.
When are you trying to get the combobox to requery? As the pop-up
closes?
If so, does this statement not work? (assuming this is in the pop-ups
OnClose event)
I see that my original statements may not have worked since you are
using control names that make you use [ ].

Forms("[F-PERS]").Controls("[F-CREDsub]").Form.cboStatus.Requery

I usually avoid these kinds of names as it would have been slightly
shorter to write.
Forms("FPERS").FCREDsub.Form.cboStatus.Requery

Feb 14 '07 #3
THANKYOU !!!! Mike Storr

This worked perfectly:
Forms("[F-PERS]").Controls("[F-CREDsub]").Form.cboStatus.Requery

I new I was having trouble with the Syntax all along.
I probably did not explain myself properly in a previous post.

Thanks Again
Greg

Feb 14 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: John Tyce | last post by:
When a button is clicked, a date is inserted or added into a combo box like this : ComboBox.Items.Add(string) or ComboBox.Items.Insert(0,string); Either way, the new string does not show up in the...
5
by: Gil | last post by:
Is there a way to tell if a combbox is in dropdown mode. I tried and if statement combobox.dropdown = true but i get an error. dropwndown function doesnt store if its true or false what i am...
0
by: lv2compute | last post by:
I am having a problem with my datagridview. I have a small table that has two columns. The first column is bound to my dataset. The second column is a combobox. I add items to the combobox based on...
6
by: Scotty | last post by:
Hi, I need some info How to return the value from the database My combobox Me.cboTypeAdres.Items.Add("Type Adres") Me.cboTypeAdres.Items.Add("Leverancier")...
1
by: MrNobody | last post by:
I have a ComboBox on my form, and I set it's DataSource to an ArrayList of custom objects. Everything loads fine, all the entries I initially loaded into the ArrayList appear in my ComboBox. ...
5
by: active | last post by:
I tried to use a datasource with a combobox and it didn't work completely so I build a small test that was much more straight forward then the app. The test was to see if the combobox dropdown...
2
by: billa856 | last post by:
Hi, My project is in MS Access. In that I have one Form in which I have some Comboboxes. 1st one is Independent, 2nd one is dependent on first one, 3rd one is dependent on 1st and 2nd both....
4
by: EManning | last post by:
I have a combobox whose rowsource is a union query. This query displays a person's name in "lastname, firstname" format and in "firstname lastname" format. The query results look like this: ...
4
by: EManning | last post by:
Using A2003 w/ tables linked to SQL Server. All users have their own copy of the mdb. I have a combobox whose rowsource is a query. This query is based on a table and has a field in it that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.