requery question

  • Thread starter Thread starter John
  • Start date Start date
J

John

I have a form (usrfrmClientSelection) that has on it a
combo box (cboAcctMgt). The combo box has a value list
attached to that has 3 choices. On another form
(usrfrmGeneralInformation) is another combo box
(cboAcctMgtPerson) that lists names associated with the
selection made in cboAcctMgt.

Generally, usrfrmGeneralInformation is open when the
cboAcctMgt would be used. But there are times when it is
not. I have the SELECT statements that fills
cboAcctMgtPerson but only after I do a requery of
usrfrmGeneralInformation. They are currently in the
OnCurrent event of usrfrmGeneralInformation.

If I put them in the AfterUpdate of cboAcctMgt I will get
an error if usrfrmGeneralInformation is not open.

Where is the best place to locate the SELECT statements
so the requery does not need to be done each time so
cboAcctMgtPerson fills? Both forms are tied to the same
table.

Thanks for assistance.
 
John,

If the Rowsource for [cboAcctMgtPerson] is pointing to [cboAcctMgt] for a
criteria, then the issue is that form, [usrfrmClientSelection] is closed,
not where you are requerying.

Here is a suggestion. It seems that if form [usrfrmClientSelection] is
closed then combobox, [cboAcctMgtPerson] should display all of the results.
If that is correct, I suggest setting the Rowsource property in the Load
event of [usrfrmGeneralInformation] when it opens, something like this:

If IsLoaded("usrfrmClientSelection") then
[cboAcctMgtPerson].RowSource = "Select .... Whatever with a criteria"
Else
[cboAcctMgtPerson].RowSource = "Select .... Whatever without a
criteria"
End If

If you have a Criteria to filter the Rowsouce in case 2 then the SQL should
specify that. I don't know enough about your app to know.

God Bless,

Mark A. Sam
 
Mark, thanks for the info. I think you got me going in
the right direction.
*** John

-----Original Message-----
John,

If the Rowsource for [cboAcctMgtPerson] is pointing to [cboAcctMgt] for a
criteria, then the issue is that form,
[usrfrmClientSelection] is closed,
not where you are requerying.

Here is a suggestion. It seems that if form [usrfrmClientSelection] is
closed then combobox, [cboAcctMgtPerson] should display all of the results.
If that is correct, I suggest setting the Rowsource property in the Load
event of [usrfrmGeneralInformation] when it opens, something like this:

If IsLoaded("usrfrmClientSelection") then
[cboAcctMgtPerson].RowSource = "Select .... Whatever with a criteria"
Else
[cboAcctMgtPerson].RowSource = "Select .... Whatever without a
criteria"
End If

If you have a Criteria to filter the Rowsouce in case 2 then the SQL should
specify that. I don't know enough about your app to know.

God Bless,

Mark A. Sam


I have a form (usrfrmClientSelection) that has on it a
combo box (cboAcctMgt). The combo box has a value list
attached to that has 3 choices. On another form
(usrfrmGeneralInformation) is another combo box
(cboAcctMgtPerson) that lists names associated with the
selection made in cboAcctMgt.

Generally, usrfrmGeneralInformation is open when the
cboAcctMgt would be used. But there are times when it is
not. I have the SELECT statements that fills
cboAcctMgtPerson but only after I do a requery of
usrfrmGeneralInformation. They are currently in the
OnCurrent event of usrfrmGeneralInformation.

If I put them in the AfterUpdate of cboAcctMgt I will get
an error if usrfrmGeneralInformation is not open.

Where is the best place to locate the SELECT statements
so the requery does not need to be done each time so
cboAcctMgtPerson fills? Both forms are tied to the same
table.

Thanks for assistance.


.
 
Back
Top