Open singleview form with cbo restricted to the SB combobox value

M

Mishanya

I have SwitchBoard with cboSelectReferent and control-button wich is supposed
to open MyForm.
MyForm has cboSelectClient and shows information bound to the selected client.

1) I need to program the SB button to open MyForm with cboSelectClient value
list restricted to the referent, selected in the cboSelectReferent.
2) If no referent is selected, I want the MyForm to open with unrestricted
cboSelectClient value list.
3) If possible, MyForm will always open blank (not with the first client
recordset), then I could select client from restricted/unrestricted
cboSelectClient (I can do so now by having "DoCmd.GoToRecord , , acNewRec"
command in OnOpen event, but it might not work if MyForm will be opened by
the restricting operation).

please help.
 
K

Ken Sheridan

The RowSource property of cboSelectClient should be a query which restricts
the rows returned to those where the Referent column matches the currently
selected referent in the switchboard form's cboSelectReferent control or
that control is Null (which will return all referents in the list). In query
design view put the following (all as one line) in the Criteria row of the
Referent column:

Forms!frmSwitchboard!cboSelectReferent Or
Forms!frmSwitchboard!cboSelectReferent Is Null

Opening the form at a new record as you are at present should pose no problem.

Ken Sheridan
Stafford, England
 
M

Mishanya

Thank U!

Ken Sheridan said:
The RowSource property of cboSelectClient should be a query which restricts
the rows returned to those where the Referent column matches the currently
selected referent in the switchboard form's cboSelectReferent control or
that control is Null (which will return all referents in the list). In query
design view put the following (all as one line) in the Criteria row of the
Referent column:

Forms!frmSwitchboard!cboSelectReferent Or
Forms!frmSwitchboard!cboSelectReferent Is Null

Opening the form at a new record as you are at present should pose no problem.

Ken Sheridan
Stafford, England
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top