Open singleview form with cbo restricted to the SB combobox value

  • Thread starter Thread starter Mishanya
  • Start date Start date
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.
 
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
 
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
 
Back
Top