By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,934 Members | 1,449 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,934 IT Pros & Developers. It's quick & easy.

ComboBox Refresh from PopupForm Revisited

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.